// Open the Registry key, if it doesn't exist, it will be created.
RegCreateKeyEx(HKEY_LOCAL_MACHINE,
"SOFTWARE\\AVTRON MANUFACTURING\\ADDAPT\\DON\\ADDAPT",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ,
NULL,
&hk,
&dwDisp);
// Check to see if the install date has been set in the registry entry. If it doesn't exist, create
// the registry entry.
int iRetVal = RegQueryValueEx(hk,
"USR:App Name\\Section1",
NULL,
NULL,
NULL,
NULL);
if (daysLeft <= 0)
{
strMessage.Format("ADDapt was not activated within 30 days of \n"
"installation, and will currently not function. \n"
"To activate, please call Avtron Field Service \n"
"at 216-642-1230 ext 1214.\n"
"The %d days trial period started on the day you installed ADDapt.\n"
"The application will now close.", daysLeft);
//AfxMessageBox(strMessage, MB_OK | MB_ICONSTOP);
CProductCodeDlg dlg;
dlg.DoModal();
// User selected No, close the application.
return FALSE;
}
else
{
strMessage.Format(_T("ADDapt is operating under a trial license. \n")
_T("You have %d" " days to activate ADDapt with a valid license.\n")
_T("To activate, Please call Avtron Field Service at 216 642-1230 ext 1214. \n")
_T("Do you want to Proceed?"), daysLeft);
int iRespVal = AfxMessageBox(strMessage, MB_YESNO | MB_ICONEXCLAMATION);
// User selected No, close the application.
if(iRespVal == IDNO)
return FALSE;
}
if (pAddaptApp->m_bSA_Available)
m_strSA = "Available";
if (pAddaptApp->m_bViewer_Available)
m_strViewer = "Available";
if (pAddaptApp->m_bProductCodeFound)
{
m_strAddapt98 = "Available";
if( pAddaptApp->m_bViewer_Available )
bDisableEntry = TRUE; // all options are available - good customer
} // dont let anyone screw things up
else
{
if (m_dwProductCode == 0)
m_strAddapt98 = "Activation Required";
else
m_strAddapt98 = "Product Code Invalid";
What I am trying to do here once the product code insert in PROCUDTCODE FORM it will mentioned that it is AVAILABLE and MAIN MANU FORM will pop and application remains working.