Re: RegClosekey returning wrong value in Vista business
You didn't include a code snippet, and this really isn't a
programming-centric newsgroup.
I would strongly believe that RegCloseKey is returning 'invalid handle'
because your handle is invalid.
Using my psychic debugging abilities, I bet you are using something similar
to this code:
RegOpenKeyEx( HKEY_LOCAL_MACHINE, L"Software\\Contoso\\SubKey", 0,
KEY_QUERY_VALUE, &hKey );
...
RegCloseKey( hKey );
- where you are a) assuming administrative credentials you never
automatically have (not on XP either, given that there are non-admin users
there too) and b) not properly checking the return value of RegOpenKey or
RegCreateKey or similar.
This is a complete and utter guess given the lack of code snippet. I
apologize if I'm off-base.
--
Speaking for myself only.
See http://zachd.com/pss/pss.html for some helpful WMP info.
This posting is provided "AS IS" with no warranties, and confers no rights.
--
"dhanya" wrote in message
news:0a7fe06a862c377cd5f97577c14b3614@nntp-gateway.com...
>
> I am using VC++6.0 editor in Vista.
> I was earlier running my application in windows Xp.
> As per requirement i ported it to Vista machine and the application is
> crashing.
> The problem is that in many places the RegCloseKey() is returning value
> 6(invalid handle) instead of zero.so the application is failing.
> Please help me why RegCloseKey() is not working properly in Vista but
> in XP.
> Same cod in XP,the RegCloseKey() is returning zero.
> Please help me.
>
> Thanks
> DG
>
>
> --
> dhanya
date: Wed, 17 Sep 2008 23:08:44 -0700
author: zachd [MSFT]