PRB: ATL COM AppWizard Doesn't Offer MFC Support for .EXE
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
This article was previously published under Q181505
On This Page
SYMPTOMS
The ATL COM AppWizard does not offer the option of MFC support for an .exe
project. Adding an MFC class with ClassView or ClassWizard results in build
errors.
To add minimal MFC support to an ATL COM AppWizard project, follow these
steps:
1.
Open the ATL project with Visual C++.
2.
On the Project menu, click Settings.
3.
Under the General tab, set the Microsoft Foundation Classes field to
"Use MFC in a Shared DLL" or "Use MFC in a Static Library". Click OK.
4.
Open the project StdAfx.h header file. Add the following line after
"#define STRICT", then save and close the file:
#include <afxdisp.h>
5.
Open the project .rc source file in text mode for editing:
a.
On the File menu, click Open.
b.
Highlight the <projectname>.rc file.
c.
Set the Open As field to "Text", then click Open.
d.
Click OK on any resulting message boxes.
6.
Replace all occurrences of Winres.h with Afxres.h in the .rc file,
then save and close the file.
7.
Delete the <projectname>.clw file if it already exists.
8.
Invoke ClassWizard by clicking ClassWizard on the View menu. Click Yes
when prompted to rebuild the ClassWizard database, and then click OK on
the next dialog box.
MFC class files added with ClassView or ClassWizard should now build
without errors.
NOTE: In Visual C++ 6.0, another option exists. Create an MFC project
first, and then click New ATL Object on the Insert menu. Click OK on the
next dialog box to insert ATL support into the MFC project.
Need More Help? Contact a Support professional by Email, Online or Phone.
Customer Service For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
Newsgroups Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.