Hello Mustafin Artur
1. Here's an excerpt on ProjectGen cut from our VBA walkthrough...(just use your app name instead of ShapeAppVBA)
Creating the ShapeAppVBA Project Templates
Once you have registered the host application, added the proxy assembly to the global assembly cache, and suppressed the runtime exceptions, you can successfully load the ProjectGen.exe wizard that will guide you through the creation of the project templates.
|
To run the ProjectGen.exe Wizard |
|
1. Open the Visual Studio 2005 Command Prompt, and change the path to x:\ProjectGen\x86.
2. Execute the following command:
ProjectGen.exe |
There are four pages in the Project Template Wizard that must be completed before you can continue. The following sections describe the values for each of the fields on each page in the wizard. The first page is the Specify Template Properties page.
|
To complete the Specify Template Properties page |
|
1. In the Template name field, type ShapeAppVBA Add-in. This specifies the name of the add-in displayed on the Templates pane of the New Project dialog.
2. In the Template description field, type A project for creating add-ins for ShapeAppVBA. This description will appear above the Name box of the New Project dialog whenever the associated template is selected.
3. In the Default project name field, type ShapeAppVBA. This name will be used as the default project name that appears in the New Project dialog box. An incremental number is appended to this name for each project created.
4. In the Template icon box, click the ellipsis (…) button and navigate to the %SYSTEMDRIVE%\Program Files\Microsoft Visual Studio 8\Common7\IDE\Extensibility Projects\Visual Studio Add-In.ico. This is the icon that will appear in the Templates pane on the New Project dialog.
5. In the Host identifier list, select ShapeAppVBA. If successfully registered, ShapeAppVBA will automatically be added to this list of available host identifiers.
6. Click Next to continue to the next page of the wizard. |
The next page is the Specify Host Item page.
|
To complete the Specify Host Item page |
|
1. In the Proxy assembly name field, click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\ShapeAppVBAProxy\bin\Debug\ShapeAppVBA.Proxy.Dll proxy assembly.
2. In the Base type list, select ShapeAppVBA.Application.
3. In the Host item name field, type ThisApplication. This name is used to determine the name of the code file. For example, ThisApplication.cs and ThisApplication.vb.
4. Leave the remaining fields empty, and click Next to continue to the next page of the wizard. |
The next page is the Specify Project Properties page.
|
To complete the Specify Project Properties page |
|
1. In the Debug exe field, click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\Debug\ShapeAppVBA.exe application.
2. Leave the remaining fields empty, and click Next to continue to the next page of the wizard. |
The next page is the Generate Project Template page.
|
To complete the Generate Project Template page |
|
1. Check the Create project template box, if not already checked, and then click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\Templates directory.
2. Check the Register template with host application box, if not already checked.
3. Check the Save project template descriptor file box, if not already checked, and then click the ellipsis (…) button and navigate to the %SHAPEAPPVBA% directory, and name the file ShapeAppVBADescriptor.xml.
4. Click Finish to complete the wizard.
5. Click OK on the Registering Project Templates dialog, after the templates have been successfully registered. |
Now that the project templates have been created, you can test to see that they are accessible from within Visual Studio Tools for Applications.
|
To test the ShapeAppVBA project templates |
|
1. Open the Visual Studio 2005 Command Prompt, and change the path to %SYSTEMDRIVE%\Program Files\Microsoft Visual Studio 8\Common7\IDE.
2. Execute the following command:
vsta /hostid ShapeAppVBA
3. On the File menu, click New Project.
4. In the Project Types pane, select the Visual C# node.
5. In the Templates pane, select ShapeAppVBA Add-in, and click OK.
6. Verify that the ShapeAppVBA Add-in project opens in the Visual Studio Tools for Applications IDE. |
2. ProxyGen error: I suspect that this is a localization/internationalization problem. Please send along your exact syntax and your full path. Then we will reproduce this and report it as a proxygen bug to Microsoft.
Workaround:
a. Can you add the path to proygen.exe into your environment path, so that it is available in any folder location) from the commandline without specifying a path? like this:
C:> ProxyGen
b. Next, can you go to the proxy folder for your integration and use local paths for proxygen from the commandline? This will remove the full path syntax from your proxygen usage and should give you success.
3. You can read about HostItemProvider in VSTA help documentation that comes with VSTA. Can you find the Visual Studio SDK in the filter list you MS Document Explorer? The HostItemProvider, is the root of your addin's object model. (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vstasdk/html/2abcfef0-409d-4787-8fb2-38472f86ed05.htm). There needs to be a root or entrypoint specified for the addin's view of your application object (ie: what shows up in object browser and in intellisense while writing macro)
4. These strings are used by Host app and ProjectGen for the project Template to load macros and addins. They need to match each other, or the macro/addin/template will not load. This will be obvious at runtime
5. I hope these answers have been helpful. Please continue to send along your questions.
-Gary