BOOL CDemoApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. Application *pApp = NULL; try { // Try an optional debug value to test an expired application ID: // extern const ADP_APPLICATIONID ADP_EXPIRED_APPLICATIONID; //pApp = new Application(ApplicationId(0xAE395E85,0x332E49E4,0xA250C7B0,0x34F907BC)); } catch (AdpException& e) { //cout << "The attempt to authorize the application failed!\n" << e.what() << endl; if (pApp != NULL) delete pApp; // Your code may choose to abort/exit here after informing the user of the situation MessageBox(NULL,"Application is not authorised to run on this machine, a valid Application ID is needed. Exiting....","sample app",MB_OK); ADP_Close(); //(comment this line to run the application without authorizing the application id) exit( -1 ); //(comment this line to run the application without authorizing the application id) } // ... Your code can continue..Normal operation continues here if (pApp != NULL) delete pApp; CSplashWindow::ShowSplashScreen(); CDemoDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
OnInitDialog()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)