Danintulsa
asked on
Errors porting ATL with MFC from VC98 to VS2008
I'm porting a project that was originally developed using VC98 to VS2008. The project is an ATL .exe with MFC. In my Stdafx.h if I include the files in this order:
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <afxwin.h> // MFC core and standard components
I get this error:
Error 1 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h> C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxv _w32.h 16 editclm
However if I move the afxwin.h up:
#include <afxwin.h> // MFC core and standard components
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
Some classes aren't found and I get this error:
Error 3 error C2065: 'IRulesEngine' : undeclared identifier c:\Projects\src\editclm\hp edit.cpp 37 editclm
Error 4 error C2133: 'm_pIRulesEngine' : unknown size c:\Projects\src\editclm\hp edit.cpp 37 editclm
Error 5 error C2512: 'ATL::CComPtr' : no appropriate default constructor available c:\Projects\src\editclm\hp edit.cpp 37 editclm
There must be a way to port this project... but I've looked everywhere.
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <afxwin.h> // MFC core and standard components
I get this error:
Error 1 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h> C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxv
However if I move the afxwin.h up:
#include <afxwin.h> // MFC core and standard components
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
Some classes aren't found and I get this error:
Error 3 error C2065: 'IRulesEngine' : undeclared identifier c:\Projects\src\editclm\hp
Error 4 error C2133: 'm_pIRulesEngine' : unknown size c:\Projects\src\editclm\hp
Error 5 error C2512: 'ATL::CComPtr' : no appropriate default constructor available c:\Projects\src\editclm\hp
There must be a way to port this project... but I've looked everywhere.
ASKER
IRulesEngine is a com object written in C# and exported.
From hpedit.cpp
#import "..\..\inc\InterOp.tlb" no_namespace named_guids
Does hpedit.cpp need to be importing this class in a different way?
From hpedit.cpp
#import "..\..\inc\InterOp.tlb" no_namespace named_guids
Does hpedit.cpp need to be importing this class in a different way?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hmmm... Well, apparently the tlb was out of date. I pulled its source code and did a fresh build, and things are fine now.
IRulesEngine is an interface in your code. Find this declaration in your code. It can be an external interface too - so you should have a source code for this com-object or this com-object registered on your computer and a description of this com-object.
CComPtr is in atlbase.h that is included in your stdafx.h
http://msdn.microsoft.com/en-us/library/ezzw7k98(VS.80).aspx
So I think the problem with this RulesEngine com-object.