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 have an ArcGIS 10 extension that will not launch .Startup() when ArcMap loads. I can get it to hit when I go to Customize->Extensions and un-check/re-check the extension name.

Is there a setting that I need to configure in order to have this fire when Arc is launched?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Are you using a JIT, configurable extension? JIT extensions only startup when they are called.

Regular extensions should startup together with ArcMap (wether they are configurable or not - I need to confirm this, can anyone help?)

Just-in-time Extensions

Extensions are generally loaded when an ArcGIS application first starts up. For example, in ArcMap the extension manager instantiates each extension it can find in the ESRI Mx Extensions component category and calls its IExtension::Startup method.

You may want to develop your extension to be a just-in-time (JIT) extension. The concept behind JIT extensions is to avoid creating objects until necessary; therefore, ArcMap does not start up a JIT extension until it is actually required.

http://edndoc.esri.com/arcobjects/9.0/ExtendingArcObjects/Ch03/AboutExtensions.htm

The greatest difference between them is how you register the extension. They basically implement the same interfaces. To sum it up, check the category your extension is registerd in. See the ArcGISCategoryRegistration method in your extension:

    // common extension, starts up when arc map starts
    private static void ArcGISCategoryRegistration(Type registerType)
    {
        string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
        MxExtension.Register(regKey);

    }

    // JIT extension, will only start when you first call it
    private static void ArcGISCategoryRegistration(Type registerType)
    {
        string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
        MxExtensionJIT.Register(regKey);

    }
share|improve this answer
    
I ended up flipping this to a "normal" MxExtension instead of a JIT. I had to move a bit of code away from the Startup() method in order to not lag Arc on launch, but it's working very well now. –  Nick Ochoski Sep 20 '11 at 18:15

If your Extension is in an Add-In, try setting the AutoLoad attribute to true.

  <Extensions>
    <Extension id="Microsoft_ArcMapAddin3_Extension1" autoLoad="true" class="Extension1" />
  </Extensions>
share|improve this answer

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.