IAoInitializePtr pAoInitialize(__uuidof(AoInitialize));
esriLicenseStatus licenseStatus;
licenseStatus = pAoInitialize->IsProductCodeAvailable(esriLicenseProductCodeEngineGeoDB);
if (licenseStatus != esriLicenseAvailable) return;
licenseStatus = pAoInitialize->IsProductCodeAvailable(esriLicenseProductCodeEngine);
if (licenseStatus != esriLicenseAvailable) return;
licenseStatus = pAoInitialize->IsProductCodeAvailable((esriLicenseProductCodeArcEditor));
if (licenseStatus != esriLicenseAvailable) return;
licenseStatus = pAoInitialize->IsProductCodeAvailable((esriLicenseProductCodeArcInfo));
if (licenseStatus != esriLicenseAvailable) return;
licenseStatus = pAoInitialize->Initialize(esriLicenseProductCodeEngineGeoDB);
// if(licenseStatus != esriLicenseCheckedOut) return;
licenseStatus = pAoInitialize->Initialize(esriLicenseProductCodeEngine);
//if(licenseStatus != esriLicenseCheckedOut) return;
licenseStatus = pAoInitialize->Initialize(esriLicenseProductCodeArcEditor);
// if(licenseStatus != esriLicenseCheckedOut) return;
licenseStatus = pAoInitialize->Initialize(esriLicenseProductCodeArcInfo);
// if(licenseStatus != esriLicenseCheckedOut) return;