Error : Windows.h already defined .
-
hai.dear. i opened win32 application...and i had 3 cpp files which reqd windows.h ...so i added windows.h in win32 files... now i have one cpp file which is mfc support file..mfc support means using Cstring datatype..and AFxBeginthread and some other also... so..now i have added that mfc support cpp file to my project... which is having header files #include afx.h #include afxwin.h and etc..related to mfc.. now i builded my program...it is throwing this error... fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include what to do for this error..how to solve this..
-
hai.dear. i opened win32 application...and i had 3 cpp files which reqd windows.h ...so i added windows.h in win32 files... now i have one cpp file which is mfc support file..mfc support means using Cstring datatype..and AFxBeginthread and some other also... so..now i have added that mfc support cpp file to my project... which is having header files #include afx.h #include afxwin.h and etc..related to mfc.. now i builded my program...it is throwing this error... fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include what to do for this error..how to solve this..
-
hai.. already i tried this.., still it is throwing error. becos i am using MSMQ in my project. it requires mq.h header file. this requires the windows.h header file.
-
hai.. already i tried this.., still it is throwing error. becos i am using MSMQ in my project. it requires mq.h header file. this requires the windows.h header file.
-
hai.dear. i opened win32 application...and i had 3 cpp files which reqd windows.h ...so i added windows.h in win32 files... now i have one cpp file which is mfc support file..mfc support means using Cstring datatype..and AFxBeginthread and some other also... so..now i have added that mfc support cpp file to my project... which is having header files #include afx.h #include afxwin.h and etc..related to mfc.. now i builded my program...it is throwing this error... fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include what to do for this error..how to solve this..
use
#pragma once
orifndef / ifdef
precompiler instructions to avoid repetitionsGreetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)
-
use
#pragma once
orifndef / ifdef
precompiler instructions to avoid repetitionsGreetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)
Nelek wrote:
use #pragma once or ifndef / ifdef precompiler instructions to avoid repetitions
mfc doesn't allow you to include Windows.h with it! so ifndef/ifdef will be of no use!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Nelek wrote:
use #pragma once or ifndef / ifdef precompiler instructions to avoid repetitions
mfc doesn't allow you to include Windows.h with it! so ifndef/ifdef will be of no use!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Ahhhmmm :doh: the assistant include these by default.
#include < afxwin.h > // MFC-Kern- und -Standardkomponenten
#include < afxext.h > // MFC-Erweiterungen
#include < afxdisp.h > // MFC Automatisierungsklassen
#include < afxdtctl.h > // MFC-Unterstützung für allgemeine Steuerelemente von Internet Explorer 4
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include < afxcmn.h > // MFC-Unterstützung für gängige Windows-Steuerelemente
#endif // _AFX_NO_AFXCMN_SUPPORTand with this it is supposed to have the most of the "standard" MFC functionality, isn't it? Maybe adding one of them....
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)
-
Ahhhmmm :doh: the assistant include these by default.
#include < afxwin.h > // MFC-Kern- und -Standardkomponenten
#include < afxext.h > // MFC-Erweiterungen
#include < afxdisp.h > // MFC Automatisierungsklassen
#include < afxdtctl.h > // MFC-Unterstützung für allgemeine Steuerelemente von Internet Explorer 4
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include < afxcmn.h > // MFC-Unterstützung für gängige Windows-Steuerelemente
#endif // _AFX_NO_AFXCMN_SUPPORTand with this it is supposed to have the most of the "standard" MFC functionality, isn't it? Maybe adding one of them....
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)
yeap you are right
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
hai.. already i tried this.., still it is throwing error. becos i am using MSMQ in my project. it requires mq.h header file. this requires the windows.h header file.
D.Mani wrote:
it requires mq.h header file.
So include that in the project's
stdafx.h
file, below the Afx-related includes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne