ArcEngine 10 - Cannot get license

2073
1
10-12-2011 02:38 PM
ESRICustomer
New Contributor III
My environment

  • Visual studio 2008

  • ArcEngine 10

  • VB.NET


I choose to start a new project using an ArcGIS TEmplate,
specifically, the "MapControl Application" Template.

I didn't change a single line of code, I simply ran it, and it bombed with
"You must have a license to use this ActiveX control"

Keep in mind, their own template has code in the ApplicationEvents.vb file which checks out an Engine license.

i have BOTH an engine license and desktop license on this computer.

I looked at ESRI's own advice here...
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000002ns000000

...which says to put the license checkout code in the form's Sub New() just before the call to InitializeComponent()

So I did that, ran it, and it bombed again with same message.

I attached the project so you could see for yourself.
I also attached a pic of the relevant code.
Notice in the immediate window that i have licenses.


I don't know how to get this to work programmatically.

I do NOT want to use a license control because of the nature of our application. People need to be able to start the application and use parts of it other than the map without checking out a map license, and the only way to do that is programmatically check out the license just before it's needed.

Any help is appreciated.
Thanks.
0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: CCPoston

Create a "Windows Application (Engine)" and I think you'll see that the binding must be a target of the ResolveBindingEvent. You can't just do it and be done.  You must set up the mechanism so it can be checked when necessary.
0 Kudos