我对项目的工作,需要找到软件安装日期和软件到期日期之间的时间跨度。我需要的软件弹出屏幕,计算30天,它减少了一天已经过去了。因为它是在第一AfxMessageBox提到想:
我需要显示的天在%d { strMessage.Format( "ADDapt was not activated within 30 days of " "installation and is currently not functional.\n" "To activate please call Avtron Field Service at 000-000-1230 " "ext 1214.\n" "The 30 days trial period starts on the day you installed " "ADDapt.\n" "You have %d days left to renew ADDapt Software.", daysLeft );
离开
一旦的软件reches 27日一天,我需要软件来查看以下信息:
{C}
一旦软件从试用期届满,我需要显示的安全网页,其中有这将激活该软件的ProductCode
我最大的障碍是视窗系统登录中注册该产品,一旦installdate然后想通了,它是易于使用
非常感谢您
维杰 - 帕特尔
随时致电[删除]
我工作的代码如下:
COleDateTime timeStart, timeEnd;
COleDateTimeSpan timePassed;
int daysLeft = 0;
timeStart = COleDateTime::GetCUrrentTime();
timeEnd =
timePassed = COleDateTime::GetCurrentTime( ) - timeStart;
daysLeft = 30 - static_cast< int >( timePassed.GetTotalDays( ) );
CString strMessage;
if( daysLeft > 0 )
{ strMessage.Format( "ADDapt was not activated within 30 days of " "installation and is currently not functional.\n" "To activate please call Avtron Field Service at 216-642-1230 " "ext 1214.\n" "The 30 days trial period starts on the day you installed " "ADDapt.\n" "You have %d days left to renew ADDapt Software.", daysLeft );
}
Else
{
strMessage.Format(_T(ADDapt is operating under a trial license. \n?
_T(You have %d??days to activate ADDapt with valid license, \n?
_T(To activate, Please call Avtron Field Service at 000-000-0000.?, daysLeft);
}
AfxMessageBox( strMessage );
Other code to register product is as follow:
BOOL gotTime= FALSE;
if(!gotTime)
{
if (ProductCode !+ OXeO)
else
//Code for time registration goes here
gotTime=TRUE
}