Errors in winreg.h !!!!!!!!

Hi,

I have included winreg.h in my win32 concole C++ application and erros are getting generated in this header fine. I am wondering why errors could be occured in system header file? Could any one help me here. Thanks.

The below are the errors:

Error      1      error C2146: syntax error : missing ';' before identifier 'REGSAM'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      55      
Error      2      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      55      
Error      3      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      55      
Error      4      error C2146: syntax error : missing ';' before identifier 'value_context'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      85      
Error      5      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      85      
Error      6      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      85      
Error      7      error C2146: syntax error : missing ';' before identifier 'val_buff_ptr'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      86      
Error      8      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      86      
Error      9      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      86      
Error      10      error C2143: syntax error : missing ';' before '*'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      89      
Error      11      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      89      
Error      12      error C2146: syntax error : missing ';' before identifier 'pv_valuename'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      92      
Error      13      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      92      
Error      14      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      92      
Error      15      error C2146: syntax error : missing ';' before identifier 'pv_value_context'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      94      
Error      16      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      94      
Error      17      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      94      
Error      18      error C2146: syntax error : missing ';' before identifier 'pv_type'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      95      
Error      19      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      95      
Error      20      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      95      
Error      21      error C2143: syntax error : missing ';' before '*'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      96      
Error      22      error C2371: 'FAR' : redefinition; different basic types      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      96      
Error      23      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      96      
Error      24      error C2146: syntax error : missing ';' before identifier 'pv_valuename'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      98      
Error      25      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      98      
Error      26      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      98      
Error      27      error C2146: syntax error : missing ';' before identifier 'pv_value_context'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      100      
Error      28      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      100      
Error      29      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      100      
Error      30      error C2146: syntax error : missing ';' before identifier 'pv_type'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      101      
Error      31      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      101      
Error      32      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      101      
Error      33      error C2143: syntax error : missing ';' before '*'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      102      
Error      34      error C2371: 'FAR' : redefinition; different basic types      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      102      
Error      35      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      102      
Error      36      error C2146: syntax error : missing ';' before identifier 'PPVALUE'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      108      
Error      37      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      108      
Error      38      error C2378: 'PPVALUEA' : redefinition; symbol cannot be overloaded with a typedef      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      108      
Error      39      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      108      
Error      40      error C2143: syntax error : missing ';' before '__cdecl'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      112      
Error      41      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      112      
Error      42      error C2065: 'LPVOID' : undeclared identifier      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      113      
Error      43      error C2146: syntax error : missing ')' before identifier 'keycontext'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      113      
Error      45      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      113      
Error      46      error C2059: syntax error : ')'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      114      
Error      47      error C2146: syntax error : missing ';' before identifier 'FAR'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      116      
Error      48      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      116      
Error      49      error C2378: 'QUERYHANDLER' : redefinition; symbol cannot be overloaded with a typedef      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      116      
Error      50      error C2146: syntax error : missing ';' before identifier 'pi_R0_1val'      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      119      
Error      51      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h      119
LVL 1
deshawAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Infinity08Commented:
Most likely the error is in what you placed before the #include <winreg.h>. Can you show that ?
0
SunnyDarkCommented:
You must include "windows.h"  before that
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deshawAuthor Commented:
Thanks,
0
Infinity08Commented:
>> You must include "windows.h"  before that

Does that mean that the winreg.h header is not self-sufficient ? Interesting design choice heh.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.