Microsoft KB Archive/194835

= PRB: Custom AppWizard Creates Defective 2nd-Generation Project =

Article ID: 194835

Article Last Modified on 12/8/2003

-

APPLIES TO


 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q194835



SYMPTOMS
When you build a project created with a Custom AppWizard that was based on another project, the following link errors might occur:

  mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in .obj

  mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in .obj

  Debug/ .dll : fatal error LNK1169: one or more multiply defined symbols found

  LINK : fatal error LNK1104: cannot open file "mfcapwzd.lib"



CAUSE
The Custom AppWizard project creation wizard does not carry over build configurations of base projects. Instead, it generates standard Release and Debug configurations. It ignores any custom settings in the original project, such as preprocessor defines, additional libraries, custom build steps, and so on.



RESOLUTION
Modify the project settings in the CustomizeProject function of your Custom AppWizard.



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
Starting with Visual C++ 6.0, the object model supports adding new configurations and modifying build settings for single files. Use these methods to create appropriate configurations during the CustomizeProject phase of your custom AppWizard. For more information, please see the following topics in the Visual C++ Documentation:   Visual C++ Documentation: What's New in Visual C++ 6.0 ?; What's New in Visual C++ Version 6.0 ?; Object Model

Visual C++ Documentation: Using Visual C++; Visual C++ Programmer's  Guide; Beginning Your Program; Details; AppWizard Programming Reference; CCustomAppWiz; CCustomAppWiz::CustomizeProject In Visual C++ 5.0, you may create custom build steps for an entire project, and modify project settings for the two standard configurations the Custom AppWizard generates. For additional information, please see the following article in the Microsoft Knowledge Base:

181503 PRB: Custom AppWizards Can't Make Per-File Settings/Build Steps

Steps to Reproduce Behavior
 In Visual C++ 6.0, on the File menu, click New, and then click the Projects tab. Select Custom AppWizard from the Projects list; give it a name and click OK. In this example, the name is Cstm1. Click Finish on the next dialog box, Step 1, then click OK on the confirmation dialog box.</li> Press F7 to build Cstm1. It should build without errors.</li> Now, follow steps 1 through 4 again, with the following changes:

<ol style="list-style-type: lower-alpha;"> Name the Custom AppWizard Cstm2.</li> In step 3, click Next instead of Finish, browse for Cstm1.dsp as the base project, then click Finish.</li></ol>

Continue with the following steps:

</li> From the File menu, click New, and then click the Projects tab.</li> Select Cstm2 AppWizard from the Projects list; give it a name and click OK. In this example, the name is Cstm2Proj.</li> Click OK on the confirmation dialog box. The Cstm2Proj project loads.</li> Press F7 to build Cstm2Proj.</li></ol>

RESULT: The results are as described in SYMPTOMS. The Cstm2Proj project does not build a Custom AppWizard identical to Cstm1, as you might expect.

Keywords: kberrmsg kbappwizard kbcustomwizard kbprb kbwizard KB194835

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.