OpenNETCF SaveSetting / GetSetting

  • Thread starter Thread starter anbeyon
  • Start date Start date
A

anbeyon

Hi All,

I am trying to use the OpenNETCF.VisualBasic.Interaction.SaveSetting /
GetSetting methods.

The SaveSetting works fine - I can see that data in my CE device
registry but the GetSetting method always returns a

string = Nothing

Here is what I'm doing.....

' this works
SaveSetting("MYAPP", "CONFIG", "INPUT", iSetup.ToString)

' sInput is always = Nothing
sInput = GetSetting("MYAPP", "CONFIG", "INPUT", "0")


Has anyone used these methods ?


Thanks

Anbeyon
 
Are the values present when viewed with a registry editor on the device, or
Remote Registry Editor?

You'll find them under:-
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MYAPP\CONFIG in your
example

Peter
 
Hi Peter

Thanks for the reply!!

Yes, if I use the remote registry editor and peek at the CE device I'm
working on the registry is is updated correctly by the SaveSetting
method but doesn't seem to be read by the GetSetting method.

Thanks

Anbeyon
 
I've looked through the code and there appears to be an error - it's not
returning the value obtained!
I'll make sure this is fixed for the next release, I'll try and build a
patched dll too for v1.4...

Peter
 
Thanks Peter

That great news - so once that is done, because I'm using 1.4, does
that mean I can just replace the DLL on my system ?

Anbeyon
 
There's a fairly obvious bug in the GetSetting method. In the case where
the value is successfully read, nothing is returned. You might modify the
code as follows:

' return the key

dim value as string = rk.GetValue(Key).ToString

' close the registry key

rk.Close()

' the setting was blank-save the default

'rk.SetValue(Key, [Default])

Return value ' ******* add this



Paul T.
 
Thanks Paul but I havn't downloaded the source code - just the binaries

Regards,

Anbeyon
 
Back
Top