Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to put the headers in right order?
I reed somewhere that if I put the headers in right order I will not have the next problems:

1>------ Build started: Project: save-keyboard-console-2, Configuration: Debug Win32 ------
1>  save-keyboard-console-2.cpp
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C2146: syntax error : missing ';' before identifier 'HDWP'
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C2146: syntax error : missing ';' before identifier 'MENUTEMPLATEA'
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C2146: syntax error : missing ';' before identifier 'LPMENUTEMPLATEA'
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C2065: 'CALLBACK' : undeclared identifier
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C2065: 'WNDPROC' : undeclared identifier
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


The headers:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <Winuser.h>


If the problem aren't the headers help me to fix these problems. Thanks.
Posted
Updated 4-Aug-10 11:02am
v4

1 solution

I think that your problem is not in the #include order: try replacing #include <WinUser.h> with #include <Windows.h>. This probably will fix your problem.
 
Share this answer
 
Comments
vitalik22123 4-Aug-10 17:22pm    
that don't fix the problem because I have some functions that need #include <WinUser.h< to work.
thanks -
Sauro Viti 4-Aug-10 17:45pm    
windows.h includes automatically winuser.h and it do it using the right sequence of includes required to make it work... please, try it!
vitalik22123 4-Aug-10 17:57pm    
i already tried it and did't work..
thanks
P.S.:(I think that winuser.h includes windows.h)
Sauro Viti 4-Aug-10 18:08pm    
I open windows.h on my PC, it is just about 250 lines, and in the middle of it I found:

#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>

The errors that you are experiencing are due to the types HDWP, MENUTEMPLATEA, LPMENUTEMPLATEA, CALLBACK and WNDPROC that are undefined: theys typedefs are inside windef.h and winbase.h
vitalik22123 5-Aug-10 0:28am    
thanks , i found that lines too, but still have the some problem with my code.
thanks for helping.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900