Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ATL and MFC in a COM..

140 views
Skip to first unread message

flemming eriksen

unread,
Sep 17, 2002, 7:21:11 AM9/17/02
to
Hi,
With VC7 I created a small and simple ATL component. The testing was ok But
I need MFC in the final situation, so I added "Use MFC in a shared DLL" to
the project.
Thereafter I changed the standard generated stdafx.h to have "#include
<afxwin.h>".
The stdafx can be compiled, but the standard generated file with the
implementation of WinMain (named <project>.cpp) gives compile-errors:

error C2039: 'WinMain' : is not a member of 'Ccal_servModule'
error C2504: 'CAtlExeModuleT' : base class undefined

Have tried the include the afxwin.h different places within stdafx (and
other stuff), but no success yet.

Any ideas how to solve this standard-situation?

flemming

Kenneth Andersen

unread,
Sep 20, 2002, 6:15:26 AM9/20/02
to
Well, I haven't tried this, but can't you just check the 'Support MFC'
option in the wizard upon creation of your control??

/Kenneth

"flemming eriksen" <f27er...@kabanospam.com> wrote in message
news:#7Dw1xjXCHA.360@tkmsftngp12...

flemming eriksen

unread,
Sep 24, 2002, 5:21:45 AM9/24/02
to
If it was just that easy.
In the meantime I found Q173974 telling about this well-known problem.

Funny, MS says write components, but using ATL and MFC you have to handle
WinMain on your own!

flemming

"Kenneth Andersen" <morp...@nospam.dk> wrote in message
news:3d8af4d6$0$10685$4d4e...@news.dk.uu.net...

0 new messages