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.

Does anyone know the lifecycle of an AxControl (AxTOCControl)?

I have a complex application, that uses several technologies (Spring.NET, NHibernate, DevExpress components) among them Esri's ArcObjects.

this application starts normally, it binds a product (engine or desktop) then it gets the licence (ArcEngine), and it starts, so it is getting the proper license.

Then, minutes after the aplication has started, it throws a dialog box saying that I do not have the license of ArcView (in fact I do not have it, but i do not need it, because my code only use functionalities related with ArcEngine, not even extensions).

If i click in the button of this dialog box, then the application is closed.

I have been trying to capture the thread that launches this dialog box, but this attempt has been useless. Also I have tried using the tool Process Monitor and Process Explorer, but it has not been able to get information.

I need to understand the life cycle of the AxTOCControl to indetify when it is losing the license. Or if someone knows why a control can loss the binding to the existing license it will be very hepful!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I think I encountered a similar issue at Problem Initializing License for ArcEngine application. In my case, the application was binding just fine, as yours was, but when I tried to use any AxControls (Map, TOC, Toolbar), I got the same error that you did.

I was unable to resolve the issue with technical support, but found a workaround for my project. If you are using AoInitialize put in place by your IDE (?) (in my case this is encased in LicenseInitializer that was auto-generated for me), you can try my workaround. Perhaps it will work for you? I don't know anything about Spring, NHibernate, etc., so my apologies if the syntax below doesn't match for you. I'm using VB.net.

Quick Steps:

  1. remove all the code in the ApplicationEvents file that referred to the LicenseInitializer (if you don't have this auto-generated code, remove everything the AoInitialize class is doing)
  2. Add an AxLicenseControl to your startup form; right click and choose properties to choose the license you need.
  3. Add ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) to your startup form's Public Sub New (vb.net) or static void Main (c#)

That's what worked for me.

I found this article helpful in setting up the AxLicenseControl: ESRI how-to

share|improve this answer
    
I'm going to try it.....i really dont know how to do it (well in my environment)...but i'm going to do it –  XtianGIS Oct 16 '12 at 22:04
    
I try to remove the LicenseInitializer that was autogenerated, guess what? in an small application the Ax map controls, works fine without the license initializer....a little bug??? –  XtianGIS Oct 17 '12 at 19:40
    
I'm in the process of remove the LicenseInitializer that was auto-generated, and insert the AxLicenseControl...but i got a blocker....How do i configure the AxLicenseControl througth code (type of license)?? i perform changes in the AxLicenseControl but the changes are not reflected in the form1.designer.cs file –  XtianGIS Oct 17 '12 at 19:45
    
When I added the AxLicenseControl, I right-clicked in the form designer, chose properties, and then specified the type of license. This was not available in the normal properties window, just by right-clicking on the control in the designer. If you've done that, have you also added the RuntimeManager.Bind to static void Main? –  BeckyZ Oct 20 '12 at 23:23
    
thanks, but i need to know how to perform the same process that you describe, but using code, because i perform several geograpich objects operations prior to the load of the main form –  XtianGIS Oct 22 '12 at 15:39

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.