fatal error C1189: #error : WINDOWS.H already included  
Author Message
logitree





PostPosted: Visual C++ General, fatal error C1189: #error : WINDOWS.H already included Top

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxv_w32.h(18) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

Any suggestions

Thank you.



Visual C++10  
 
 
Ayman Shoukry - MSFT





PostPosted: Visual C++ General, fatal error C1189: #error : WINDOWS.H already included Top

I have deleted your other post. Please provide more information including a sample to reproduce the issue.

Start a new thread once you have such info.

OTP

Thanks,
Ayman Shoukry
VC++ Team


 
 
Martin Richter





PostPosted: Visual C++ General, fatal error C1189: #error : WINDOWS.H already included Top

There is explicitly the answer in the error message:

Remove any include of windows.h before you include MFC the headers (starting with afx).

Best practice: include the MFC headers first. Than you don't need the windows include file.