Hello Hyun,
Can you get back typeinformation from the IDIspatch you are passing to VSTA?
Here's how to clean up everything for a clean starting point:
- Go to the gac (C:\\windows\\assembly) and uninstall all proxy assemblies
- In the properties of the proxy assembly select Signing. Check ‘Sign the assembly’ check box. Pulldown the ‘Choose a strong name key file:’ combobox and select <new…>
- In the key file name enter key.snk (or whatever you wish). Unselect the ‘Protect my key file with a password’ entry. Click OK
- Rebuild proxy.
- gacutil – i the proxy assembly in C:\\ShapeAppBasicMFC-IDispatch\\ShapeAppBasicMFC-modified\\Proxy\\bin\\Debug
- Confirm that it is installed in C:\\windows\\assembly
Now run ProjectGen
7. Run ProjectGen and select the attached template as input. Change the naming as desired. Fix up the directory paths as needed.
8. In VSTAHookup.cs change the static string to match the naming and paths used in ProjectGen as this snippet demonstrates.
static String mAppContextName = @"Application";
static String mHostID = @"ShapeAppMFCSeamless";
static string mAppAddInPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"ShapeAppBasicMFC-IDispatch\\ShapeAppBasicMFC-modified\\Sample AddIns Seamless");
static VSTAHookup mSingleton;
internal struct AddInInfo
{
internal String mName;
internal Version mVersion;
internal bool mIsLoaded;
internal DateTime mLastLoaded;
}
static string mMacroProjectFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"ShapeAppBasicMFC-IDispatch\\ShapeAppBasicMFC-modified\\ShapeAppMFCSeamlessAppAddIn1\\ShapeAppMFCSeamlessAppAddIn1.csproj");
static string mMacroProjectPath = Path.GetDirectoryName(mMacroProjectFilePath);
static string mMacroAddInPath = Path.Combine(mMacroProjectPath, @"bin\\debug");
static string mMacroContextName = @"Macro";
static string mMacroAssemblyName = @"ShapeAppMFCSeamlessAppAddIn1.dll";
static string mAppAddInTemplateName = @"ShapeAppMFC SeamlessAddin Template.zip";
static string mAppAddInTemplateType = @"CSharp";
9. Change VSTAHookup project’s Build, Output directory to output the assembly into the ShapeAppMFC output directory. This will allow debugging into vstahookup source.
Set breakpoints in the proxy methods, the TypeInfrastructureManager methods, the HostItemProvider methods and see if everything is running the same as ShapeAppVBA during the hookup.
Have you implemented set a break point at this?
public sealed partial class CShapeAppVBAInitializer {
public static global::Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager AddTypesToMap(global::Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager) {
. . .
}
I will start integrating VSTA with the Multipad sample and let you know how it goes.
-G