1

i am using the arcGIS api to make a plugin for arcFM, when i try to run this code

 Type t = Type.GetTypeFromProgID("esriFramework.AppRef");
 System.Object obj = Activator.CreateInstance(t);
 pApp = obj as IApplication;

i get

System.Runtime.InteropServices.COMException(0x8000FFFF): Creating an instance of the component with CLSID {Appref CLSID HERE} from the IClassFactory faileddue to the following error: 8000ffff
PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Apr 25, 2011 at 19:48
3
  • Can you do a createinstance on other Esri types (e.g. esriGeometry.Point), or just having problems with AppRef? Commented Apr 25, 2011 at 20:25
  • Is this in a dll project? I wouldn't expect it to work in an exe project. Commented Apr 25, 2011 at 20:26
  • What kind of ArcFM extension are you developing? Is it an autoupdater? If that's the case, you should never rely on the IApplication being present since AUs can also be run in different context than an ESRI desktop application. Commented Apr 25, 2011 at 21:40

2 Answers 2

3

Looks like you might not have initialized the ESRI ArcObjects libraries. You have to do that, to get your license set. You need to check here; ESRI Library to make sure you are getting the libraries started up properly.

answered Apr 25, 2011 at 19:55
2
  • I am using the example code from MMStartup.cs and the exact same code seems to work fine there Commented Apr 25, 2011 at 20:00
  • 1
    Ok, Looks like I missed this - '{Appref CLSID HERE}' - to me this is looking like its not seeing your extension being registerd with ArcGIS, so it may be trying to get to your custom code and isn't knowing what to start up. Commented Apr 25, 2011 at 20:20
2

Assuming that you are running the code within an ESRI-app process (e.g. ArcMap, ArcCatalog), if you need to get a reference to a running IApplication from a standalone application, you can use the AppROT class.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Apr 25, 2011 at 21:36
1
  • how do i use the AppROT class? Commented Apr 26, 2011 at 14:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.