Problem with ArcGIS Engine not finding a license

1797
3
03-08-2012 03:33 AM
Highlighted
New Contributor
Hi,

The create_shapefile C++ example fails to run with these messages:


Could not bind to a valid ArcGIS installation.

Could not bind to a valid ArcGIS installation.

Could not bind to a valid ArcGIS installation.

Could not bind to a valid ArcGIS installation.

Could not bind to a valid ArcGIS installation.

The engine and SDk have been installed and authorised without any problem. ArcGIS desktop runs fine without complaining about a license, just the ArcObject runtime.

This is stopping us from working so any ideas would be appreciated.

Michael
Reply
0 Kudos
3 Replies
Highlighted
New Contributor
A bit more info. This sample code is where it fails:

bool InitAttemptWithoutExtension(esriLicenseProductCode product)
{
  IAoInitializePtr ipInit(CLSID_AoInitialize);

  esriLicenseStatus status = esriLicenseFailure;
  HRESULT hr = ipInit->Initialize(product, &status);
  return (status == esriLicenseCheckedOut);
}

The HR result says "Application can not be run more than once". There are no other esri apps running (or other visual studio instances). I even rebooted the machine to make sure that there were no background processes.

It is a single use license.

It has us stumped!
Reply
0 Kudos
Highlighted
Regular Contributor III
At ArcGIS 10 you have to bind to a product before attempting to check out a license.  At the top of this page is a Help link.  Follow that to the SDK help and there is a help topic on migrating your code to ArcGIS 10 that should help you.
Reply
0 Kudos
Highlighted
New Contributor
Thanks for the lead.

It is not a migration, but one of ESRI's V10.0 samples. However, your suggestion led to this bug (http://support.esri.com/en/bugs/nimbus/TklNMDYxNjUx) regarding ARCGIS_VERSION not be defined.

All resolved now.
Reply
0 Kudos