Help re Registry SDK calls via MFC Please! 
Author Message
 Help re Registry SDK calls via MFC Please!

I am writing a VB OLE control using the wizard in VC++ (MFC).

I want to call the SDK function RegOpenKeyEx which obtains a handle
to whichever registry key is specified in the parameters.

However, it will not compile. I get the message -

C2065 'RegOpenKeyEx' Undeclared Identifier.

I suspect I need to include a different .h file, as RegOpenKeyEx is
in a different DLL, but the help is fairly helpless, and I am struggling
with the problem

Any help VERY gratefully received !




Sat, 19 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

When you look in the help for this function there should be a button
that says "Quick Info".  Press this button.  It will tell you the header
file you need, the library your need and what OS's it is compatible
with.  For the record you need to include WinReg.H and then link to
ADVAPI32.LIB
--
Why are builders afraid to have a 13th floor
    but book publishers aren't afraid to have a Chapter 11?



Sat, 19 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

Or just go get the WFC from Sam Blackburn, start looking at
http://www.program.com. Sam has a great class for the Registry
--
Matt
"Cheaters don't prosper and they never will"



Quote:
> When you look in the help for this function there should be a button
> that says "Quick Info".  Press this button.  It will tell you the header
> file you need, the library your need and what OS's it is compatible
> with.  For the record you need to include WinReg.H and then link to
> ADVAPI32.LIB
> --
> Why are builders afraid to have a 13th floor
>     but book publishers aren't afraid to have a Chapter 11?



Sun, 20 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

What version of VC++ are you using?  I'm using 4.2b and it compiled
fine without me adding any other include files.



Quote:
> I am writing a VB OLE control using the wizard in VC++ (MFC).

> I want to call the SDK function RegOpenKeyEx which obtains a handle
> to whichever registry key is specified in the parameters.

> However, it will not compile. I get the message -

> C2065 'RegOpenKeyEx' Undeclared Identifier.

> I suspect I need to include a different .h file, as RegOpenKeyEx is
> in a different DLL, but the help is fairly helpless, and I am struggling
> with the problem

> Any help VERY gratefully received !





Mon, 21 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

I am using VC 4.0 and ran into the same problem. I corrected it by adding
the following line in my stdafx.cpp file:

#include <winreg.h>

Good luck.
--
John Boehme
http://www.iglobal.net/pub/JohnAndCe/webmap.htm
http://www.iglobal.net/pub/JohnAndCe/ftpcontrol.htm

Quote:


> > I am writing a VB OLE control using the wizard in VC++ (MFC).

> > I want to call the SDK function RegOpenKeyEx which obtains a handle
> > to whichever registry key is specified in the parameters.

> > However, it will not compile. I get the message -

> > C2065 'RegOpenKeyEx' Undeclared Identifier.

> > I suspect I need to include a different .h file, as RegOpenKeyEx is
> > in a different DLL, but the help is fairly helpless, and I am
struggling
> > with the problem

> > Any help VERY gratefully received !





Wed, 23 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!


Fri, 19 Jun 1992 00:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

Hope you don't mind me interjecting a short item on my wish list:

There should be one line added to the end of every function definition
listed in the Online Documentation:
include <xxx.h>

Note: I know the information can be found somewhere but this method is very
convenient for the reader.



Quote:
> When you look in the help for this function there should be a button
> that says "Quick Info".  Press this button.  It will tell you the header
> file you need,



Wed, 30 Jun 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!



Quote:
>There should be one line added to the end of every function definition
>listed in the Online Documentation:
>include <xxx.h>
>> When you look in the help for this function there should be a button
>> that says "Quick Info".  Press this button.  It will tell you the header
>> file you need,

Hallelujah! Amen, brother! I'm with ya! Testify!

Jim (3 hours looking for winreg.h !)




Sat, 03 Jul 1999 03:00:00 GMT  
 Help re Registry SDK calls via MFC Please!


Fri, 19 Jun 1992 00:00:00 GMT  
 Help re Registry SDK calls via MFC Please!

Since you're using MFC, the problem is your default setting in the stdafx.h
file for your project. The easy solution:
Open your stdafx.h file. You should see the text "#define VC_EXTRA_LEAN" or
something to that effect. Comment this line out and recompile. VC++ will
now locate all of the Windows includes you need.


Quote:

> I am writing a VB OLE control using the wizard in VC++ (MFC).

> I want to call the SDK function RegOpenKeyEx which obtains a handle
> to whichever registry key is specified in the parameters.

> However, it will not compile. I get the message -

> C2065 'RegOpenKeyEx' Undeclared Identifier.

> I suspect I need to include a different .h file, as RegOpenKeyEx is
> in a different DLL, but the help is fairly helpless, and I am struggling
> with the problem

> Any help VERY gratefully received !





Sun, 11 Jul 1999 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. NT Service Using MFC (Samples\sdk\winnt\service) PLEASE HELP

2. MFC Control OnCreate not called via VB, but called under MSVC

3. need help please please setting registry value

4. Calling a DOS app from MFC - Help Please !!

5. Help with mixing API calls and MFC, please

6. US-TX-DALLAS Call Processing Software Engineers - C, C++, NT, SQL, SDK, MFC

7. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

8. Please Help: question about overriding class methods via new

9. Please help with VC to ORACLE via ADO

10. Please help!!!!Please help!!!!Please help!!!!

11. registry question help please

12. Please help reading a registry key.

 

 
Powered by phpBB® Forum Software