Hello,
can someone tell me, why DC_RegQuery returns 2, if i query a non existing key ?
(Win7 32bit, eXPress 255)
DC_RegQuery
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
DC_RegQuery
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DC_RegQuery
hi,
all Value <> 0 return from DllCall meen "fail"
Error Code you will find in Winerror.h
all Value <> 0 return from DllCall meen "fail"
Error Code you will find in Winerror.h
greetings by OHR
Jimmy
Jimmy
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DC_RegQuery
Hi Roger,
does DC_RegQuery only returns strings, so if it returns a numeric, it is the error code from the DLL call ?
I thought, that if the key does not exists, DC_RegQuery returns an empty string.
If so, please correct the docs.
does DC_RegQuery only returns strings, so if it returns a numeric, it is the error code from the DLL call ?
I thought, that if the key does not exists, DC_RegQuery returns an empty string.
If so, please correct the docs.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DC_RegQuery
DC_RegQuery() makes a Windows API call that returns an ambiguous value.
I have always wondered how to deal with this problem.
If the value stored is a numeric value of 2, then the returned value is also 2, which is ambiguous.
I have always wondered how to deal with this problem.
If the value stored is a numeric value of 2, then the returned value is also 2, which is ambiguous.
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DC_RegQuery
Hi Roger,
i think a first step can be to put an "else" in this function, so in the case the Reg Key does not exists, the function returns an empty string:
i think a first step can be to put an "else" in this function, so in the case the Reg Key does not exists, the function returns an empty string:
Code: Select all
xValue := DllCall( nDllHandle, DLL_STDCALL, "RegOpenKeyExA", nHKey, @cSubKey, ;
0, nKey, @nKeyHandle) // = 0
IF xValue == 0
................
................
ELSE
xValue:=""
ENDIF
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang