Sample code for using the License object in C++ is shown below:
#include <CHM/CHMlicense.h> #include <CHM/CHMerrorClass.h> //... int main(int,char**) { try { CHMlicense License; //Print true if machine is registered. cout << "Machine is registered: " << ( License.IsLicensed() ? "true" : "false" ) << endl; //Fetch the machine id. const char* pMachineId = License.MachineId(); cout << "The machine id is : " << pMachineId << endl; //Set a proxy if required. //License.SetProxy("webproxy.acme.com"); //Fetch the registration code. const char* pRegistrationCode = License.FetchRegistrationCode(pMachineId, "your.name@yourcompany.com", "password01", "My Development Code"); //Register this machine with this code. License.RegisterHost(pRegistrationCode); } catch (CHMerror& Error) { cerr << "Chameleon licensing error: " << Error.Description() << endl; } return 0; }
C++ Example