I got this working by making a custom version of netoffice where i have the GetImageMso() method which simply casts directly to IPictureDisp.
I did try using the CreateKnownObjectFromComProxy method first, but since all the stdole (I)Picture* stuff is interfaces, that fails when calling Activator.CreateInstance (as the interfaces does not have constructors).
Also i changed the method to return an stdole.IPictureDisp (as consistent with MS documentation) instead of an stdole.Picture as it did before (but i didn't test if both will work).
i.e. the code in my custom version is
Br
Ask
I did try using the CreateKnownObjectFromComProxy method first, but since all the stdole (I)Picture* stuff is interfaces, that fails when calling Activator.CreateInstance (as the interfaces does not have constructors).
Also i changed the method to return an stdole.IPictureDisp (as consistent with MS documentation) instead of an stdole.Picture as it did before (but i didn't test if both will work).
i.e. the code in my custom version is
public stdole.IPictureDisp GetImageMso(string idMso, Int32 width, Int32 height)
{
object[] paramsArray = Invoker.ValidateParamsArray(idMso, width, height);
object returnItem = Invoker.MethodReturn(this, "GetImageMso", paramsArray);
return (stdole.IPictureDisp)returnItem;
}
while the official 1.7.3 code is public stdole.Picture GetImageMso(string idMso, Int32 width, Int32 height)
{
object[] paramsArray = Invoker.ValidateParamsArray(idMso, width, height);
object returnItem = Invoker.MethodReturn(this, "GetImageMso", paramsArray);
stdole.Picture newObject = Factory.CreateObjectFromComProxy(this, returnItem) as stdole.Picture;
return newObject;
}
Sebastian: maybe you can provide some insight into what is the correct approach here?Br
Ask