Problem with ArcGIS Engine not finding a license

2024
3
03-08-2012 03:33 AM
MichaelEvans
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
0 Kudos
3 Replies
MichaelEvans
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!
0 Kudos
NeilClemmons
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.
0 Kudos
MichaelEvans
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.
0 Kudos