• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1375
  • Last Modified:

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
0
deshaw
Asked:
deshaw
  • 2
1 Solution
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now