Reply to: Interacting with running XMAXJuly 11, 2011 at 9:32 pm
xmaxROTid = Register_OLE32(“XMetaL.Control”, Me.AxXMetaLControl) // BAD ASSUMPTION IS HERE
“Me.AxXMetaLControl” is some .NET COM-callable wrapper object around XMAX. It is not an object with an IXMetaLControl interface you can query directly. So, that is why you get E_NOINTERFACE HRESULT.
I am not trying to get the IXMetaLControl instance within macros. I create my plugin instance via CreateObject call in the On_Macro_File_Load handler. In the FinalConstruct method (C++ project) of the plugin I try to get the IXMetaLControl instance.
I am not so sure about that. Think about the call-stack…isn't FinalConstruct executed within the scope of On_Macro_File_Load? Either way, it is not a big deal.