C++ / Add Class / Class Wizard replacement

Hi,

 I want to create a more flexible C++ Class wizard then the existing one.

 I want to access my wizard from the "Add/class" contextual menu item, the same way as the current wizard is accessed, or add my own "Jamea Class" under the "Add" contextual menu item.

 Three questions:

  1. What extensibility machanism I would want to use to create the wizard I know some VB and no C# ( I am a quick learner though )
  2. Would it be possible to append my own "Add/Jamea Class" entry in the contextual menu in solution explorer or class view
  3. if number 2 is not possible, then how do I add my "wizard" next to the C++ "C++ Class" wizard in the "Add class" dialog

Thanks for your replies.

 Product: Visual Studio 2005



Answer this question

C++ / Add Class / Class Wizard replacement

  • Christian Winter

    Exporting templates from a C++ project is not supported. The Export Template wizard only exports templates from VB, C#, or J# project types.

    Craig



  • NerdAndy

    This would be very easy to do. First, create a template (the File | Export Template tool is a good start). The template will be placed in the Add New Item dialog box by default, which is what you want to do since you will want the user to add the item to the project if they right click and say Add | New Item. The second step is to add an item to the context menu. This can be done by running the Add-in wizard, selecting to create a tools menu item. When the code has been generated, find where the Tools menu is found and change this to the name of the context menu for the project (see the post at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=212110&SiteID=1 for more information). Finally, in the Exec method of the Add-in, call DTE.LaunchWizard, passing in the path to the .vstemplate file you created earlier, which can be found using the method EnvDTE.Solution2.GetProjectItemTemplate(...).

    Craig



  • Shining Arcanine

    OK, so the answer to my problem would then be.....
  • Raven-X

    Hi,

    Thanks for your reply. After I iopen the VC++ ( non MFC ) solution, and choose "export template", both of the "From which project" and the "What language category" drop down lists are empty.

    Btw, I want to create a C++ class wizard with some smarts like inheritence, multiple inheritence, interface, etc...not just a class based on some "template" class.

    Thanks for your help.


  • C++ / Add Class / Class Wizard replacement