rhorner

license issue

Discussion created by rhorner on Aug 10, 2011
I've use the following with arcgis 9....to get a license for sometime now.  We now have some members with arcgis 10 license manager installed and my programs cannot get a license.  I've been looking for some answers on goolge but no luck.  Do I need to recompile my programs with arcgis 10 installed? Arcmap 10 runs fine so the license is available.  Thanks for any help

    // ********** check esri license
    esriLicenseStatus mystatus;    
    IAoInitializePtr ao = IAoInitializePtr(CLSID_AoInitialize);
    ao->Initialize(esriLicenseProductCodeEngineGeoDB,&mystatus);
    if (mystatus!=esriLicenseCheckedOut)
    {
         ao->Initialize(esriLicenseProductCodeArcEditor,&mystatus);
         if (mystatus!=esriLicenseCheckedOut)
         {
              ao->Initialize(esriLicenseProductCodeArcInfo,&mystatus);
              if (mystatus!=esriLicenseCheckedOut)
              {
                   mess.Format("No ESRI License available.");
                   cout << (LPCTSTR)mess << endl;
                   return 0;
              }
              else
              {
                   mess.Format("Using esriLicenseProductCodeArcInfo ESRI License.");
                   cout << (LPCTSTR)mess << endl;
              }

         }
         else
         {
              mess.Format("Using esriLicenseProductCodeArcEditor ESRI License.");
              cout << (LPCTSTR)mess << endl;
         }
    }
    else
    {
         mess.Format("Using esriLicenseProductCodeEngineGeoDB ESRI License.");
         cout << (LPCTSTR)mess << endl;
    }

Outcomes