chpicker
Programmer
- Apr 10, 2001
- 1,316
I followed some sample code for reading registry values. For the most part they are pretty simple, I can read any string values I like. However, Binary or DWORD values always return an error code of -106. I cannot find a reference to this error code anywhere in WinError.H and cannot for the life of me imagine what could be wrong. Here is some sample code:
[tt]
set classlib to home()+"ffc\registry" ADDITIVE
oReg=CreateObject("registry"
p_cRegName=""
* Next line returns 0 (ERROR_SUCCESS)
?oReg.GetRegKey("lfFaceName",@p_cRegName,;
"Software\Microsoft\Notepad",oReg.nUserKey)
* Next line prints the value from the registry
?p_cRegName
p_cRegName=0 && Set numeric
* Next line returns -106 (No clue)
?oReg.GetRegKey("lfItalic",@p_cRegName,;
"Software\Microsoft\Notepad",oReg.nUserKey)
* Next line shows value was unchanged
?p_cRegName
[/tt]
You'll notice that I went ahead and set p_cRegName to a numeric value before trying to call it the second time although that is unnecessary.
Anyone know what error -106 is? Is there something special you have to do to retrieve a numeric value?
Ian
[tt]
set classlib to home()+"ffc\registry" ADDITIVE
oReg=CreateObject("registry"

p_cRegName=""
* Next line returns 0 (ERROR_SUCCESS)
?oReg.GetRegKey("lfFaceName",@p_cRegName,;
"Software\Microsoft\Notepad",oReg.nUserKey)
* Next line prints the value from the registry
?p_cRegName
p_cRegName=0 && Set numeric
* Next line returns -106 (No clue)
?oReg.GetRegKey("lfItalic",@p_cRegName,;
"Software\Microsoft\Notepad",oReg.nUserKey)
* Next line shows value was unchanged
?p_cRegName
[/tt]
You'll notice that I went ahead and set p_cRegName to a numeric value before trying to call it the second time although that is unnecessary.
Anyone know what error -106 is? Is there something special you have to do to retrieve a numeric value?
Ian