Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > RegClosekey returning wrong value in Vista business

Reply
Thread Tools Display Modes

RegClosekey returning wrong value in Vista business

 
 
dhanya
Guest
Posts: n/a

 
      09-04-2008

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
 
Reply With Quote
 
 
 
 
zachd [MSFT]
Guest
Posts: n/a

 
      09-18-2008

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:...
>
> 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



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any chance of returning Vista for XP at Circuit City?? 46erjoe@nospam.com Windows Vista General Discussion 40 08-06-2008 01:25 AM
vista not working after returning from holiday jabet Windows Vista General Discussion 4 02-26-2008 01:50 AM
Vista search isn't returning Excel files Martin LaBar Windows Vista File Management 2 07-02-2007 09:30 PM
Trying Vista, Returning to Windows XP roy.schestowitz@yahoo.com Windows Vista General Discussion 6 04-02-2007 03:47 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59