A Journey 2 Eternity

How to add MFC support to a simple ATL project

Posted on: December 1, 2008

Step 1:

Add the following:

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS

#include < afxwin.h >

#ifndef _AFX_NO_OLE_SUPPORT

#include < afxdisp.h > // MFC Automation classes

#endif // _AFX_NO_OLE_SUPPORT

This block should be added before #define _ATL_ALL_WARNINGS

Step 2:

In Configuration properties -> General -> Projects Defaults -> Use of MFC, Select “Use MFC in a Shared DLL”

Step 3:

In the Configuration properties -> C/C++ ->Preprocessor Options section of the Compiler Settings if you are using _USRDLL and _AFXDLL together, try to remove _USRDLL and rebuild again.

We can just add ATL dialog in our project. But there will be some problems such as we can’t add Control variables.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Pages

Categories

December 2008
M T W T F S S
« Sep   Apr »
1234567
891011121314
15161718192021
22232425262728
293031  

Blog Stats

  • 27,491 hits
%d bloggers like this: