I want to read from the registry and added code like this:

lRet = RegOpenKeyEx ( HKEY_LOCAL_MACHINE,
_T("Services\\Smbserver\\Shares\\Printer"),
0,
KEY_QUERY_VALUE,
&hKey );

if ( lRet == ERROR_SUCCESS )
{

This works as expected. If I change where to read from to a key named
"Version" that I have created myself in HKLM\SOFTWARE\Company this
does not work. The value of iRet becomes ERROR_FILE_NOT_FOUND. I am
sure the key exist, as I can read if rom the remote registry editor.
Any ideas why this does not work are welcome.

Re: Read from registry problem by Paul

Paul
Mon Feb 05 10:46:12 CST 2007

Sorry, but you're wrong; the key doesn't exist. Either your "Version" key
is not a key but a value or your path to it is wrong in the call.

Paul T.

<dgipling@vcegroup.com> wrote in message
news:1170676839.784445.323860@a34g2000cwb.googlegroups.com...
>I want to read from the registry and added code like this:
>
> lRet = RegOpenKeyEx ( HKEY_LOCAL_MACHINE,
> _T("Services\\Smbserver\\Shares\\Printer"),
> 0,
> KEY_QUERY_VALUE,
> &hKey );
>
> if ( lRet == ERROR_SUCCESS )
> {
>
> This works as expected. If I change where to read from to a key named
> "Version" that I have created myself in HKLM\SOFTWARE\Company this
> does not work. The value of iRet becomes ERROR_FILE_NOT_FOUND. I am
> sure the key exist, as I can read if rom the remote registry editor.
> Any ideas why this does not work are welcome.
>