By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,617 Members | 1,166 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,617 IT Pros & Developers. It's quick & easy.

compiler error when using MFC with c-based application.

P: n/a
ds
fatal error C1189: #error : WINDOWS.H already included. MFC apps must
not #include <windows.h>

I have an existing C-based application. I need to add encoder card
support to this application. Encoder card Skd is vc++ based. Hence I
ported the c-code into VC++. I wrote a class for encoder card (.cpp)
and included <afxwin.h>. The class itself compiles fine though when I
make a reference of this c++ class in the main (c-code), I get the
above error.

In the project options, I force a c++ compilation by /TP.

If I dont force /TP, I get the following error,
fatal error C1189: #error : MFC requires C++ compilation (use a .cpp
suffix)

References:
main.c (#include "myEncoder.h")
myEncoder.h (#include <afxwin.h>)

If I dont refer myEncoder.h in main.c, everything compiles fine. I need
to make calls to encoder class. Please advise.
Thank you,
-Divyang.

Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ds wrote:
fatal error C1189: #error : WINDOWS.H already included. MFC apps must
not #include <windows.h>

I have an existing C-based application. I need to add [...]


Wrong newsgroup. Please visit 'microsoft.public.vc.mfc'.

V
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.