HOWTO: Creating a Custom AppWizard that Creates Java Projects

ID: Q207592


The information in this article applies to:
  • Microsoft Visual Studio 97
  • Microsoft Visual J++, versions 1.0, 1.1
  • Microsoft Visual C++, 32-bit Editions, version 5.0


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.

  1. 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.




  2. Click Finish and click OK when the confirmation dialog box appears.


  3. Select the ClassView tab and expand the C<your project name>AppWiz class. Double-click InitCustomAppWiz to edit this member function.


  4. In the implementation for InitCustomAppWiz, add the following after the // TODO comments:


  5. 
    <your project name>aw.m_Dictionary.SetAt(_T("PROJTYPE_JAVA"), _T("1") ); 
  6. Override CCustomAppWz::GetPlatforms(StringList& rPlatforms) in your C<your project name>AppWiz class.


  7. Remove references to the Win32 x86 platform by placing the following code in the implementation of GetPlatforms.


  8. 
    POSITION pos = rPlatforms.GetHeadPosition();
    
    while( pos != NULL)
    
    {
    
       POSITION posCurr = pos;
    
       CString strPlatform = rPlatforms.GetNext(pos);
    
       if( strPlatform.Left(5) == _T("Win32") )
    
          rPlatforms.RemoveAt(posCurr);
    
    } 
  9. Build your project.


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.


REFERENCES

MSDN Library : Developer Products; Visual C++; Visual C++ Programmer's Guide; Beginning Your Program; Creating a Custom AppWizard

Additional query words: kbDSupport

Keywords : kbwizard kbide kbVC500 kbVJ100 kbVJ110 kbVS97 kbAppWizard kbCustomWizard kbDSupport kbGrpDSTools
Version : WINDOWS:1.0,1.1,97; winnt:5.0
Platform : WINDOWS winnt
Issue type : kbhowto


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.