Put something like this in the command's OnCreate() method (not in the constructor, especially if you're using a just-in-time extension, because the extension may not be loaded yet when the command is constructed):
UID uid = new UIDClass();
uid.Value = "MyNamespace.MyJITExtension";
m_extension = (MyJITExtension)m_application.FindExtensionByCLSID(uid);
uid.Value = "MyNamespace.MyJITExtension";
m_extension = (MyJITExtension)m_application.FindExtensionByCLSID(uid);
The above method worked fine for me with ArcGIS 9.3 and Visual Studio 2008. I came across the following error when using ArcGIS 10 and Visual Studio 2010:
Error 4: Interop type 'ESRI.ArcGIS.esriSystem.UIDClass' cannot be embedded. Use the applicable interface instead.
To solve this problem, change the Embed Interop Types property for each referenced ESRI assembly to False. Or don't target .NET Framework 4.0.
Thanks A LOT!!! Was trying to build an ArcGIS engine application and this helped me out. God bless!
ReplyDeleteMystino Casino - Free Play in Demo Mode - Casino In Japan
ReplyDeleteMystino Casino online slot game has a great RTP and an 다파벳 excellent sign-up fun88 soikeotot bonus ミスティーノ that will increase your chances of winning. The game is