I have a Wizard project I'm working on to create a solution, add projects to the
solution, yadda yadda. Now I'm trying to add classes/modules using the .vsz
wizard file. I tried using the AddFromTemplate method of the ProjectItems
collection, but that only accepts .vb or .vbproj files (so far). It does not
accept the vbproj. Not only that, when I use AddFromTemplate, it doesn't change
the template values in the template, just copies the file to the destination
directory and adds it to the project. The [! ...] vals are left intact!
So, I'm left with using the LaunchWizard method. Fine, used it before...but not
for adding items. I am getting a ComException when I execute the following code:
Dim contextParams As Object() = { _
EnvDTE.Constants.vsWizardAddItem, _
Project.Name, _
Project.ProjectItems, _
Me.LocalPath, _
"common.vb", _
"C:\Program Files\Microsoft Visual Studio .Net 2003\Vb7", _
True _
}
Try
.DTE.LaunchWizard(templatePath & "Module.vsz", contextParams)
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
I believe it is because of the third contextParam item. The Project.ProjectItems
collection. In the MSDN documentation, that parameter is supposed to be a
"pointer" to the Project.ProjectItems object. So, how do I go about doing that?
Thanks in advance...
Mythran