Error trying to get CommPort discovery working

djmrozinski

Member
Licensed User
Hello,

I have been playing with the ComPort.shp file has is posted in the forum. It is designed to allow you to gather ComPort information. Very nice code, but I am having one little problem.

Everything works except then "FriendlyName" value.

When the code tries to execute the Reg.GetValue(key,"FriendlyName") I get an error that say something about Iconvertible.

Search the forum with no success. Anyone else had any luck.

Thanks
Dave
 

djmrozinski

Member
Licensed User
I just installed Basic4PPC in March, so I have the new versions on the device.

Any other suggestions.

Thanks
Dave
 

djmrozinski

Member
Licensed User
still getting the same error.

"Object must implement IConvertible. Continue?"

RegistryDevice.dll Version 1.0.2911.26229
SerialDevice.dll (one you sent)

I'm using Serial2.dll with my application

Thanks for the help
Dave
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Sorry, I've attached the wrong library. It should have been RegistryDevice.dll not SerialDevice.dll
The zip file is now updated.
The most updated RegistryDevice.dll was modified on 12/21/2007.
Please make sure that you are using it.
Please add the following line before the problematic line and see if it returns a Null value.
B4X:
Msgbox(IsNull(reg.GetValue(key,"FriendlyName")))
 

djmrozinski

Member
Licensed User
Erel,

I inserted the line of code you suggested and played around a little bit. I have determined that when the program get to COM2: Drivers\BuiltIn\IrDa and then moves to the code to get the "FriendlyName" the error is generated.

Does give you any clue. I am really stumpped.

Thanks for all the help
Dave
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi,
I am seeing the same error.

The error does not show up under the old compiler
and there is no error either when compiled optimized and running under WM6.

Error condition, as far as I observed: optimized compiled and PPC 2003.
It must be related to the conversion of the "FriendlyName" key/data.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Trying to narrow down:

If a value does not exist, GetString returns NullException error, while GetValue returns that IConvertable message (optimized compiler and PPC 2003). Assumingly, the got value can't be converted to a string.

According to Registry Help, both can be used to get REG_SZ values.

Instead of NullException, GetString should ideally return an empty string.
Catching up NullExceptions while quering registry entries in a For...Next loop is not feasable.

There are no such issues with the old compiler or optimized compiled running under WM5/6.
 

djmrozinski

Member
Licensed User
Hello,

I got the same error as well. You also suggested Reg.GetObject, I don't see that support in the help file. Was that correct?

Thanks and keep me updated.

Dave
 

djmrozinski

Member
Licensed User
I assumed the Reg.GetObject should be Reg.GetValue It still gave the same error.

Thanks again for all the help.

Dave
 

alfcen

Well-Known Member
Licensed User
Longtime User
Lovely, Erel, performs like a charm.
Your responsiveness to support issues and your expertise are out of this world!
 
Top