D djmrozinski Member Licensed User Apr 6, 2008 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2008 #2 The Registry libraries in the zip file were outdated. Please download it and try again: http://www.b4x.com/forum/showthread.php?p=1273#post1273 Make sure to replace the old libraries.
The Registry libraries in the zip file were outdated. Please download it and try again: http://www.b4x.com/forum/showthread.php?p=1273#post1273 Make sure to replace the old libraries.
D djmrozinski Member Licensed User Apr 6, 2008 #3 I just installed Basic4PPC in March, so I have the new versions on the device. Any other suggestions. Thanks Dave
I just installed Basic4PPC in March, so I have the new versions on the device. Any other suggestions. Thanks Dave
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2008 #4 Please copy the attached executable and library to the device. Try to run the executable and see if it works. Attachments ComPorts.zip ComPorts.zip 16.6 KB · Views: 413
Please copy the attached executable and library to the device. Try to run the executable and see if it works.
D djmrozinski Member Licensed User Apr 6, 2008 #5 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
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 Apr 7, 2008 #6 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. Code: Copy Msgbox(IsNull(reg.GetValue(key,"FriendlyName")))
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. Code: Copy Msgbox(IsNull(reg.GetValue(key,"FriendlyName")))
D djmrozinski Member Licensed User Apr 8, 2008 #7 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
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 Apr 8, 2008 #8 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2008 #9 Please try to use GetString instead: Code: Copy If Not(IsNull(Reg.GetValue(key,"FriendlyName"))) Then al1.Add(name & ": " & reg.GetString(key,"FriendlyName")) End If
Please try to use GetString instead: Code: Copy If Not(IsNull(Reg.GetValue(key,"FriendlyName"))) Then al1.Add(name & ": " & reg.GetString(key,"FriendlyName")) End If
alfcen Well-Known Member Licensed User Longtime User Apr 9, 2008 #10 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Apr 9, 2008 #11 Do you get this error with the code in my previous post?
Erel B4X founder Staff member Licensed User Longtime User Apr 9, 2008 #13 I will update the Registry library so GetString will handle null values properly.
D djmrozinski Member Licensed User Apr 9, 2008 #15 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
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
Erel B4X founder Staff member Licensed User Longtime User Apr 9, 2008 #16 :signOops: Please try the following code: Code: Copy If Not(IsNull(Reg.GetValue(key,"FriendlyName"))) Then al1.Add(name & ": " & reg.GetString(key,"FriendlyName")) End If
:signOops: Please try the following code: Code: Copy If Not(IsNull(Reg.GetValue(key,"FriendlyName"))) Then al1.Add(name & ": " & reg.GetString(key,"FriendlyName")) End If
D djmrozinski Member Licensed User Apr 10, 2008 #17 I assumed the Reg.GetObject should be Reg.GetValue It still gave the same error. Thanks again for all the help. Dave
I assumed the Reg.GetObject should be Reg.GetValue It still gave the same error. Thanks again for all the help. Dave
Erel B4X founder Staff member Licensed User Longtime User Apr 30, 2008 #18 I've attached an update to RegistryDevice.dll that should return an empty string instead of null values. Please test your application with it. Attachments RegistryDevice.zip RegistryDevice.zip 4.1 KB · Views: 347
I've attached an update to RegistryDevice.dll that should return an empty string instead of null values. Please test your application with it.
alfcen Well-Known Member Licensed User Longtime User Apr 30, 2008 #19 Lovely, Erel, performs like a charm. Your responsiveness to support issues and your expertise are out of this world!
Lovely, Erel, performs like a charm. Your responsiveness to support issues and your expertise are out of this world!