Q:
I would like to continue with the OMAgent thus avoiding the annoying hard coded proxy which is used in the ShapeApp samples. Is it somehow possible to take the NND functionality from the ‘ShapeAppMFC-MultiMacroStorageV3’ or another sample and add it to the ‘ShapeAppBasicMFCWithOMAgent’?
What seems to be the current problem is the call to GetHostObject which fails when running from the IDE (i.e. from OnBuildDone), thus the remoteObject becomes null:
proxyOMAgent.cs:
void Microsoft.VisualStudio.Tools.Applications.Runtime.IEntryPoint.Initialize(global::System.IServiceProvider serviceProvider)
{
…
this.remoteObject = this.providerHost.GetHostObject(this.PrimaryType, this.PrimaryCookie) as OMAgent;
…
}
A:
>>Is it somehow possible to take the NND functionality from the ‘ShapeAppMFC-MultiMacroStorageV3’ or another sample and add it to the ‘ShapeAppBasicMFCWithOMAgent’?
Yes, and it's not too difficult.
>>What seems to be the current problem is the call to GetHostObject which fails when running from the IDE (i.e. from OnBuildDone), thus the remoteObject becomes null.
proxyOMAgent.cs:
void Microsoft.VisualStudio.Tools.Applications.Runtime.IEntryPoint.Initialize(global::System.IServiceProvider serviceProvider)
{
…
this.remoteObject = this.providerHost.GetHostObject(this.PrimaryType, this.PrimaryCookie) as OMAgent;
…
}
Be sure that you are loading the correct add-in and correct proxy and that the hosttypemap provider code in the host application is finding and providing the correct type inside the method
GetHostObject(this.PrimaryType, this.PrimaryCookie)
Posted
May 26 2009, 01:13 PM
by
BillL