Compilation error between "afxwin.h" and "windows.h" (MFC

Compilation error between "afxwin.h" and "windows.h" (MFC

Anonymous
Not applicable
910 Views
2 Replies
Message 1 of 3

Compilation error between "afxwin.h" and "windows.h" (MFC

Anonymous
Not applicable
Hello everybody ! ... I'm very happy to find this news group talking about
ARX developpement.


... Well, I'm using the ObjectArxSDK 2000 to create my arx file. I'm really
not expert, just starting ... so ....


I have created an arx file without mfc support because I just needed an
'InputMonitor' class first ... I have finished and I can create the Arx file
with no errors, and also load it.

... -> But know, i want to install a hook on AutoCAD and i always don't need
any mfc support for my project but, i have seen that it is required for the
Hooks, so i have written 2 more includes files in the "stdafx.h" file :

____________________________________________________________________

#include "afxwin.h" // need this because rxmfcapi.h needs windows header.
#include "rxmfcapi.h"
____________________________________________________________________


Because the 'acedRegisterFilterWinMsg()' and 'acedRemoveFilterWinMsg()'
function are defined in it. But now i get a new error ? :
___________________________________________________________________

c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) :
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not
#include
______________________________________________________________________

A error message generated by an #error directive in "afxv_w32.h" file
(VC6++)

So, what can i do ? I can not include the "afxwin.h" in my project because
of the "'Windows.h' already include error". And if i don't put the
"afxwin.h" file, i get errors in the "rxmfcapi.h" file.

Does it mean that i have to re-start all my project from the begining and
check for MFC support ? Or perhaps i can change some options for the linker,
or something else ??? I have already chek for MFC support in the preoject
settings, because it was not. But nothing has changed, i've got always the
error .


Well, thank's to anyone ...

Driss.
0 Likes
911 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
> Does it mean that i have to re-start all my project from the begining and
> check for MFC support ? Or perhaps i can change some options for the linker,
> or something else ??? I have already chek for MFC support in the preoject
> settings, because it was not. But nothing has changed, i've got always the
> error .

If you haven't done alot of work you should probably just start a new project
and copy any work you've done to the new project. There are preprocessor
defines and linker settings that some into play as well as the includes you've
run into. Normally you should include any afx*.h files in the stdafx.h header
between the undefines for _DEBUG.

|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
| Autodesk Registered Developer
| email: byron@cadwerx.net
| web site: http://www.cadwerx.net
|
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanl you Byron, i'm going to try that ...

Driss.


"Byron Blattel" a écrit dans le message
news: 3BDF645A.59A230EF@Tired-of-spam.org...
>
> > Does it mean that i have to re-start all my project from the begining
and
> > check for MFC support ? Or perhaps i can change some options for the
linker,
> > or something else ??? I have already chek for MFC support in the
preoject
> > settings, because it was not. But nothing has changed, i've got always
the
> > error .
>
> If you haven't done alot of work you should probably just start a new
project
> and copy any work you've done to the new project. There are preprocessor
> defines and linker settings that some into play as well as the includes
you've
> run into. Normally you should include any afx*.h files in the stdafx.h
header
> between the undefines for _DEBUG.
>
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> | Autodesk Registered Developer
> | email: byron@cadwerx.net
> | web site: http://www.cadwerx.net
> |
0 Likes