PRB: ATL COM AppWizard Doesn't Offer MFC Support for .EXE (181505)
The information in this article applies to:
- The AppWizard, when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q181505 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.
RESOLUTION
To add minimal MFC support to an ATL COM AppWizard project, follow these
steps:
- Open the ATL project with Visual C++.
- On the Project menu, click Settings.
- 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.
- Open the project StdAfx.h header file. Add the following line after
"#define STRICT", then save and close the file:
#include <afxdisp.h>
- Open the project .rc source file in text mode for editing:
- On the File menu, click Open.
- Highlight the <projectname>.rc file.
- Set the Open As field to "Text", then click Open.
- Click OK on any resulting message boxes.
- Replace all occurrences of Winres.h with Afxres.h in the .rc file,
then save and close the file.
- Delete the <projectname>.clw file if it already exists.
- 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.
STATUS
This behavior is by design.
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.
REFERENCES
For more detailed information on adding MFC support to an ATL project,
please see the following article in the Microsoft Knowledge Base:
173974
HOWTO: Add MFC Support to an ATL Project
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbpending kbprb kbwizard KB181505 |
---|
|