Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
share|improve this question
    
Can you do a createinstance on other Esri types (e.g. esriGeometry.Point), or just having problems with AppRef? –  Kirk Kuykendall Apr 25 '11 at 20:25
    
Is this in a dll project? I wouldn't expect it to work in an exe project. –  Kirk Kuykendall Apr 25 '11 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. –  Petr Krebs Apr 25 '11 at 21:40
add comment

2 Answers

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.

share|improve this answer
    
I am using the example code from MMStartup.cs and the exact same code seems to work fine there –  Eric Fode Apr 25 '11 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. –  D.E.Wright Apr 25 '11 at 20:20
add comment

Are you 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.

share|improve this answer
    
how do i use the AppROT class? –  Eric Fode Apr 26 '11 at 14:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.