fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h></windows.h> [modified]
-
I have a non MFC project with couple of .h and .cpp files. Now i wnat to add a class CDbOperations to that project temporarily which will handle the database interatctions. I have used CDatabase, CString, CSemaphore classes in CDbOperations class. I have added required includes as
#include <afxdb.h>
#include <afxmt.h>int my CDbOperations.h file. When i compile the project i got this error
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
How can i solve this error.
Saadhinchaali
modified on Wednesday, February 4, 2009 2:13 AM
-
I have a non MFC project with couple of .h and .cpp files. Now i wnat to add a class CDbOperations to that project temporarily which will handle the database interatctions. I have used CDatabase, CString, CSemaphore classes in CDbOperations class. I have added required includes as
#include <afxdb.h>
#include <afxmt.h>int my CDbOperations.h file. When i compile the project i got this error
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
How can i solve this error.
Saadhinchaali
modified on Wednesday, February 4, 2009 2:13 AM
Tritva wrote:
I have a non MFC project with couple of .h and .cpp files.
Tritva wrote:
I have used CDatabase, CString, CSemaphore classes in CDbOperations class.
Your app is no longer non MFC app. Classes you mentioned above are from MFC.
Regards, Sandip.
-
I have a non MFC project with couple of .h and .cpp files. Now i wnat to add a class CDbOperations to that project temporarily which will handle the database interatctions. I have used CDatabase, CString, CSemaphore classes in CDbOperations class. I have added required includes as
#include <afxdb.h>
#include <afxmt.h>int my CDbOperations.h file. When i compile the project i got this error
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
How can i solve this error.
Saadhinchaali
modified on Wednesday, February 4, 2009 2:13 AM
Try removing
#include <windows.h>
from your code.«_Superman_»
-
Tritva wrote:
I have a non MFC project with couple of .h and .cpp files.
Tritva wrote:
I have used CDatabase, CString, CSemaphore classes in CDbOperations class.
Your app is no longer non MFC app. Classes you mentioned above are from MFC.
Regards, Sandip.
Hi Sandip,
SandipG wrote:
Your app is no longer non MFC app.
Yes. you are right. But before using that classes, i was developing a non mfc project. Since i needed a dabase interatction i used those classes. Now it has become an mfc project. Is there a way to getrid of that error?
Saadhinchaali
-
Try removing
#include <windows.h>
from your code.«_Superman_»
Hi, Thank you for the reply. I have not added the line #include <windows.h> any where in my application.
Saadhinchaali
-
Hi, Thank you for the reply. I have not added the line #include <windows.h> any where in my application.
Saadhinchaali
-
Hi Smith, I dont have a stdafx.h file in my project. I have created an empty console application and created my .h and .cpp files later.
Saadhinchaali
-
I have a non MFC project with couple of .h and .cpp files. Now i wnat to add a class CDbOperations to that project temporarily which will handle the database interatctions. I have used CDatabase, CString, CSemaphore classes in CDbOperations class. I have added required includes as
#include <afxdb.h>
#include <afxmt.h>int my CDbOperations.h file. When i compile the project i got this error
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
How can i solve this error.
Saadhinchaali
modified on Wednesday, February 4, 2009 2:13 AM
Where are you including
afxwin.h
at?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch