Microsoft KB Archive/207592

= How To Creating a Custom AppWizard that Creates Java Projects =

Article ID: 207592

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual J++ 1.0 Standard Edition
 * Microsoft Visual J++ 1.1 Standard Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition

-



This article was previously published under Q207592



SUMMARY
Using the standard MFC AppWizard as a reference, you can create Custom AppWizards that creates programs for your work environment. This article describes the steps necessary to create a Custom AppWizard in Visual C++ that will generate Visual J++ projects.

NOTE: The steps described in this article are specific to Visual Studio 97. In Visual Studio 6, Visual C++ and Visual J++ are not integrated into the same development environment.



MORE INFORMATION
The following steps can be used to create Custom AppWizards that creates programs for your work environment.

 Create a new Custom AppWizard Project.  Select "Your own custom steps". If you try to create it from an existing Java project, it will not work. Select the number of custom steps you'd like.  Click Finish and click OK when the confirmation dialog box appears. Select the ClassView tab and expand the C AppWiz class. Double-click InitCustomAppWiz to edit this member function.  In the implementation for InitCustomAppWiz, add the following after the // TODO comments: aw.m_Dictionary.SetAt(_T("PROJTYPE_JAVA"), _T("1") ); </li> Override CCustomAppWz::GetPlatforms(StringList& rPlatforms) in your C AppWiz class.</li>  Remove references to the Win32 x86 platform by placing the following code in the implementation of GetPlatforms. POSITION pos = rPlatforms.GetHeadPosition;

while( pos != NULL)

{

POSITION posCurr = pos;

CString strPlatform = rPlatforms.GetNext(pos);

if( strPlatform.Left(5) == _T("Win32") )

rPlatforms.RemoveAt(posCurr);

}                   </li> Build your project.</li></ol>

When you create projects with this Custom AppWizard, the result will be a Java project with the correct project settings and platform. You must further customize the the Custom AppWizard project to actually create Java source files and to suit it to your needs.

<div class="references_section">