15,899,475 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Vijay Pate (Top 59 by date)
Vijay Pate
7-Feb-12 16:21pm
View
or same thing can be done from assembly
Vijay Pate
7-Feb-12 15:11pm
View
thank you very much
Vijay Pate
7-Feb-12 14:49pm
View
Mr Graus,
I am creating VC++ apps with MFC and in Manuitem I have Help section which consist of About Product which has all the information but dosent have Version # and build date. and I am trying to include Version and build date in the help >> About Product.
I am including some of my code which consist of About information which will be helpfull what i am trying to do :
// Addapt.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Addaptapp.h"
#include <afxwin.h>
#include "AddInChildFrm.h"
#include "FaultFIFOChildFrame.h"
#include "AddaptDoc.h"
#include "AddaptView.h"
#include "AddaptDocTemplate.h"
#include "AddInManager.h"
#include "TextDoc.h"
#include "TextView.h"
#include "DSDoc.h"
#include "DSGridFrm.h"
#include "PWDoc.h"
#include "PWReg.h"
#include "PWAppIO.h"
#include "PWUpdate.h"
#include "PWLogin.h"
#include "PWChgDlg.h"
#include "PWGridFrm.h"
#include "time.h"
#include "FaultFifoView.h"
#include "FaultFifoDoc.h"
#include "FileNewDlg.h"
#include "CfgDirDlg.h"
#include "ProductCode.h"
#include "Splash.h"
#include "AddaptMDIChildFrame.h"
#include "DriveFrame.h"
#include "Parameters.h"
#include "OptionsPropertySheet.h"
#include <winnetwk.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// the help file name
//#define _CRTDBG_MAP_ALLOC
//#include <stdlib.h>
//#include <crtdbg.h>
/////////////////////////////////////////////////////////////////////////////
// CAddaptApp
BEGIN_MESSAGE_MAP(CAddaptApp, CWinApp)
//{{AFX_MSG_MAP(CAddaptApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_OPEN_DEFAULTCFG, OnOpenDefaultCfg)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_HELP, OnHelp)
//}}AFX_MSG_MAP
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnEnableFileNew)
ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnEnableEditCut)
ON_UPDATE_COMMAND_UI(ID_OPEN_DEFAULTCFG, OnEnableDefaultConfig)
ON_COMMAND(ID_CONFIG_FILES, OnConfigFilesDlg)
ON_UPDATE_COMMAND_UI(ID_CONFIG_FILES, OnEnableConfigFilesDlg)
ON_UPDATE_COMMAND_UI(IDC_ADD_STTN, OnEnableAddSection)
ON_COMMAND(IDC_ADD_STTN, OnAddSection)
ON_UPDATE_COMMAND_UI(IDC_ADD_ROW, OnEnableAddRow)
ON_COMMAND(IDC_ADD_ROW, OnAddRow)
ON_COMMAND(ID_CAL_FILE_NEW, OnCalFileOpen)
ON_UPDATE_COMMAND_UI(ID_CAL_FILE_NEW, OnEnableCalFileOpen)
ON_UPDATE_COMMAND_UI(ID_ACTIVITY, OnCheckActivityIndicator)
ON_COMMAND(ID_ACTIVITY, OnActivityIndicator)
ON_UPDATE_COMMAND_UI(IDC_DRIVEGRID, OnEnableDSGrid)
ON_COMMAND(IDC_DRIVEGRID, OnDSGrid)
ON_UPDATE_COMMAND_UI(IDC_LOGIN, OnEnableLogin)
ON_COMMAND(IDC_LOGIN, OnLogin)
ON_UPDATE_COMMAND_UI(IDC_LOGOUT, OnEnableLogout)
ON_COMMAND(IDC_LOGOUT, OnLogout)
ON_UPDATE_COMMAND_UI(IDC_PRODUCT_CODE, OnEnableProductCode)
ON_COMMAND(IDC_PRODUCT_CODE, OnProductCode)
ON_UPDATE_COMMAND_UI(IDC_CHANGE_PASSWORD, OnEnableChangePassword)
ON_COMMAND(IDC_CHANGE_PASSWORD, OnChangePassword)
ON_UPDATE_COMMAND_UI(IDC_CONFIGURE, OnEnablePasswordConfig)
ON_COMMAND(IDC_CONFIGURE, OnPasswordConfig)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddaptApp construction
CAddaptApp::CAddaptApp() : m_pFaultFIFOTemplate(NULL), m_bGXInitialized(FALSE),
m_bConfigOpen(FALSE), m_bEthernet(FALSE), m_b8024(FALSE),
m_bMonitorActivity(FALSE), m_bDSGridStatus(0),
m_bRestoreWindows(0), m_bCanAdd(0), m_bBlockCommTest(0),
m_bIsWindowsNT4orLater(0), m_bIsWindows98orLater(0),
m_bBeta(0)
{
m_hwndDialog=NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CAddaptApp object
CAddaptApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CAddaptApp initialization
BOOL CAddaptApp::InitInstance()
{
Vijay Pate
7-Feb-12 11:44am
View
How about just Version #
I have figure it out to insert Date into Registry
Vijay Pate
30-Jan-12 8:27am
View
Hi Jochen Thank you for your help and I like to confirm the code you sent me 1 1/2 week ago looks correct or not:
SetAvailability();
COleDateTime timeStart;
COleDateTimeSpan timePassed;
int daysLeft = 0;
HKEY hk;
DWORD dwDisp;
// Open the Registry key, if it doesn't exist, it will be created.
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\AVTRON MANUFACTURING\\ADDAPT\\PARAMETERS",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ,
NULL,
&hk,
&dwDisp);
// Check to see if the product code has been set in the registry entry.
int iRetValProdCode =
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
NULL,
NULL);
CAddaptApp* pAddaptApp = (CAddaptApp*)AfxGetApp();
if(iRetValProdCode != ERROR_SUCCESS)
{
DWORD cbData = sizeof(pAddaptApp->m_dwProductCode);
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
(LPBYTE)&pAddaptApp->m_dwProductCode,
&cbData);
}
if(iRetValProdCode != ERROR_SUCCESS || pAddaptApp->m_dwProductCode == 0)
{
//Chack to see if the install date has been set in the registry entry.
// IF it dosen't exist create
// the registry entry
DWORD dwStart = static_cast<dword>(time(NULL) / (24L * 3600L));
DWORD cbData = sizeof(DWORD);
int iRatVal = RegSetValueEx(hk,
"FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
sizeof(DWORD));
//COleDateTime currDateTime = COleDateTime::GetCurrentTime();
//if(iRetVal !=ERROR_SUCCESS)
{
//Get elapsed days:
int iRetVal = RegQueryValueEx(hk,
"FirstInstallDateTime",
0,
NULL,
(LPBYTE)&dwStart,
&cbData);
DWORD dwPassed = static_cast<dword>(time(NULL) / (24L * 3600L)) - dwStart;
int nDaysLeft = 30 - static_cast<int>(dwPassed);
}
//timeStart = COleDateTime::GetCurrentTime();
CString strMessage;
if (daysLeft <= 0)
{
CProductCodeDlg dlg;
dlg.DoModal();
if(pAddaptApp->m_dwProductCode != 0)
{
// Create the product code registry entry.
RegSetValueEx(hk,
"Activated ProductCode",
0,
REG_DWORD,
(LPBYTE) &pAddaptApp->m_dwProductCode,
sizeof(pAddaptApp->m_dwProductCode));
}
else
{
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;
}
}
}
Vijay Pate
19-Jan-12 8:01am
View
your previous note work fine but I got into other issue when I am trying to activate product in trial period I still get following message and does same thing if it is done after trial period over any idea?
Thank you very much
Vijay Pate
18-Jan-12 15:20pm
View
Thank you very much and it worked just fine
Vijay Pate
18-Jan-12 10:55am
View
What you have mentioned I have copied your code as follow Could you please make it sure it is correct:
SetAvailability();
COleDateTime timeStart;
COleDateTimeSpan timePassed;
int daysLeft = 0;
HKEY hk;
DWORD dwDisp;
// Open the Registry key, if it doesn't exist, it will be created.
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\AVTRON MANUFACTURING\\ADDAPT\\PARAMETERS",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ,
NULL,
&hk,
&dwDisp);
// Check to see if the product code has been set in the registry entry.
int iRetValProdCode =
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
NULL,
NULL);
CAddaptApp* pAddaptApp = (CAddaptApp*)AfxGetApp();
if(iRetValProdCode != ERROR_SUCCESS)
{
DWORD cbData = sizeof(pAddaptApp->m_dwProductCode);
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
(LPBYTE)&pAddaptApp->m_dwProductCode,
&cbData);
}
if(iRetValProdCode != ERROR_SUCCESS || pAddaptApp->m_dwProductCode == 0)
{
//Chack to see if the install date has been set in the registry entry.
// IF it dosen't exist create
// the registry entry
DWORD dwStart = static_cast<dword>(time(NULL) / (24L * 3600L));
DWORD cbData = sizeof(DWORD);
int iRatVal = RegSetValueEx(hk,
"FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
sizeof(DWORD));
//COleDateTime currDateTime = COleDateTime::GetCurrentTime();
//if(iRetVal !=ERROR_SUCCESS)
{
//Get elapsed days:
int iRetVal = RegQueryValueEx(hk,
"FirstInstallDateTime",
0,
NULL,
(LPBYTE)&dwStart,
&cbData);
DWORD dwPassed = static_cast<dword>(time(NULL) / (24L * 3600L)) - dwStart;
int nDaysLeft = 30 - static_cast<int>(dwPassed);
}
//timeStart = COleDateTime::GetCurrentTime();
CString strMessage;
if (daysLeft <= 0)
{
CProductCodeDlg dlg;
dlg.DoModal();
if(pAddaptApp->m_dwProductCode != 0)
{
// Create the product code registry entry.
RegSetValueEx(hk,
"Activated ProductCode",
0,
REG_DWORD,
(LPBYTE) &pAddaptApp->m_dwProductCode,
sizeof(pAddaptApp->m_dwProductCode));
}
else
{
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;
}
}
}
Vijay Pate
18-Jan-12 9:20am
View
what is best way to describe this issue so that I can get correct answer, on "It is the version of MFCO42D.DLL"
Vijay Pate
17-Jan-12 8:41am
View
what can I do to resolve this issue.
I have developer MFC project on Win 2000 with INSTALL PACKAGE name is Creator Install Pro and deploy that into WIN Xp and while install or deploy I get this error. I am new to VC++ and I am getting this error for ASSERTION with Line 32 on oletyplb.cpp.
Thank you in advance.
Vijay Pate
16-Jan-12 8:53am
View
According to your previous note where shold I insert your code in Following coed.
Thank you very much.
SetAvailability();
COleDateTime timeStart;
COleDateTimeSpan timePassed;
int daysLeft = 0;
HKEY hk;
DWORD dwDisp;
// Open the Registry key, if it doesn't exist, it will be created.
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\AVTRON MANUFACTURING\\ADDAPT\\PARAMETERS",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ,
NULL,
&hk,
&dwDisp);
// Check to see if the product code has been set in the registry entry.
int iRetValProdCode =
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
NULL,
NULL);
CAddaptApp* pAddaptApp = (CAddaptApp*)AfxGetApp();
if(iRetValProdCode != ERROR_SUCCESS)
{
DWORD cbData = sizeof(pAddaptApp->m_dwProductCode);
RegQueryValueEx(hk,
"Activated ProductCode",
NULL,
NULL,
(LPBYTE)&pAddaptApp->m_dwProductCode,
&cbData);
}
if(iRetValProdCode != ERROR_SUCCESS || pAddaptApp->m_dwProductCode == 0)
{
DWORD dwStart = static_cast<dword>(time(NULL) / (24L * 3600L));
DWORD cbData = sizeof(DWORD);
int iRatVal = RegSetValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
sizeof(DWORD));
COleDateTime currDateTime = COleDateTime::GetCurrentTime();
//if(iRetVal !=ERROR_SUCCESS)
{
//Get elapsed days:
int iRetVal = RegQueryValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
NULL,
(LPBYTE)&dwStart,
&cbData);
DWORD dwPassed = static_cast<dword>(time(NULL) / (24L * 3600L)) - dwStart;
int nDaysLeft = 30 - static_cast<int>(dwPassed);
}
timeStart = COleDateTime::GetCurrentTime();
CString strMessage;
if (daysLeft <= 30)
{
CProductCodeDlg dlg;
dlg.DoModal();
if(pAddaptApp->m_dwProductCode != 0)
{
// Create the product code registry entry.
RegSetValueEx(hk,
"Activated ProductCode",
0,
REG_DWORD,
(LPBYTE) &pAddaptApp->m_dwProductCode,
sizeof(pAddaptApp->m_dwProductCode));
}
else
{
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;
}
}
}
Vijay Pate
16-Jan-12 8:47am
View
I have never worked on VC++ 6.0 and I am more in.NET that is only reason I am posting this help .
Although thank you very much for your help.
Vijay Pate
16-Jan-12 8:22am
View
Could you please help me where should I insert following code in the code I sent you :
DWORD dwStart = static_cast(time(NULL) / (24L * 3600L));
DWORD cbData = sizeof(DWORD);
RegSetValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
&cbData);
//Get elapsed days:
RegQueryValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
&cbData);
DWORD dwPassed = static_cast(time(NULL) / (24L * 3600L)) - dwStart;
int nDaysLeft = 30 - static_cast(dwPassed);
Vijay Pate
16-Jan-12 7:58am
View
WHile installing the software on PC and at the end of installation. that when oletyp[lb.cpp error came into existance.
Thank you very much.
Vijay Pate
12-Jan-12 14:12pm
View
I am also having some other issue with window registry when I am activating the product in tgrial period(between zero to 30 days) it is not makning entry in win registry but it works only when trial period end.
Thank you very much
Vijay Pate
12-Jan-12 14:01pm
View
your code worked fine but Instead of vetting AfxmessageBox mentioned in folowing message:
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);
I am getting Product code box that not what I am looking for.
Thank you very much.
Vijay Pate
12-Jan-12 13:24pm
View
I am gettting following error when Installing the product:
Debug Assertion Failed
File: oletyplb.cpp
line: 31
Vijay Pate
12-Jan-12 8:48am
View
I am still having same issue for not able to install and able to work while installing it give me assertion error and oletyplb.cpp error and upload is not working correctly.
Vijay Pate
11-Jan-12 15:10pm
View
No difference I am getting same error and not able to get this MFC APPLICATION. But Thank you very much.
Vijay Pate
11-Jan-12 14:05pm
View
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(304) : error C2664: 'RegSetValueExA' : cannot convert parameter 6 from 'unsigned long *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(311) : error C2664: 'RegQueryValueExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
AddaptDoc.cpp
after finish writing following Code:
DWORD dwStart = static_cast<dword>(time(NULL) / (24L * 3600L));
DWORD cbData = sizeof(DWORD);
RegSetValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
&cbData);
//Get elapsed days:
RegQueryValueEx(hk,
"USR:App Name\\FirstInstallDateTime",
0,
REG_DWORD,
(LPBYTE)&dwStart,
&cbData);
DWORD dwPassed = static_cast<dword>(time(NULL) / (24L * 3600L)) - dwStart;
int nDaysLeft = 30 - static_cast<int>(dwPassed);
Vijay Pate
11-Jan-12 13:06pm
View
One of the error is:
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2065: '_time64' : undeclared identifier
Vijay Pate
11-Jan-12 12:48pm
View
I am still using VC ++ 6.0
Vijay Pate
11-Jan-12 12:28pm
View
hi Jochen,
When I copied your code it gave me error after I gave declaration of #include "time64.h"
is Fatal Error C1083: cannot open include file: time64.h: no such file.
If I dont declare #include "time64.h", It give me 19 error and those erroe is :
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2065: '_time64' : undeclared identifier
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2059: syntax error : 'bad suffix on number'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2146: syntax error : missing ')' before identifier 'L'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2146: syntax error : missing '(' before identifier 'L'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2059: syntax error : 'bad suffix on number'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(298) : error C2059: syntax error : ')'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(301) : error C2664: 'RegSetValueExA' : cannot convert parameter 6 from 'unsigned long *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(302) : error C2065: 'Get' : undeclared identifier
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(302) : error C2146: syntax error : missing ';' before identifier 'elapsed'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(302) : error C2065: 'elapsed' : undeclared identifier
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(302) : error C2146: syntax error : missing ';' before identifier 'days'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(304) : error C2664: 'RegQueryValueExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(305) : error C2059: syntax error : 'bad suffix on number'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(305) : error C2146: syntax error : missing ')' before identifier 'L'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(305) : error C2146: syntax error : missing '(' before identifier 'L'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(305) : error C2059: syntax error : 'bad suffix on number'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(305) : error C2059: syntax error : ')'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(306) : error C2061: syntax error : identifier 'dwPassed'
C:\ADDAPT2000\ADDAPT.EXE\AddaptApp.cpp(306) : error C2146: syntax error : missing '(' before identifier 'dwPassed'
Vijay Pate
11-Jan-12 11:05am
View
being novice I dont even have idea how to write this code could you please help where should I wrote your code.
Thank you very much.
Vijay Pate
11-Jan-12 10:24am
View
I am actually working on 32 bit apps not 64 bit apps then what should I use.
Thank you very much.
Vijay Pate
4-Oct-11 15:31pm
View
no
Vijay Pate
4-Oct-11 15:16pm
View
Do you have any example I can view for the subject.
Vijay Pate
4-Oct-11 10:42am
View
Thank you for heads up and GOD BLESS YOU
Vijay Pate
4-Oct-11 10:39am
View
Deleted
GOD BLESS YOU
Vijay Pate
4-Oct-11 10:00am
View
I ment write function to convert srting into SYSTEMTIME
after that give a parameter to date in string like ('yyyy/mm/dd') as ctime to dtSystime = systemTime to return dtsystemtime
Vijay Pate
4-Oct-11 9:51am
View
my only concern is how c an I write function to convert ctime to SYSTEMTIME and where should I specify that in the code I sent you.
Thank you very much.
Vijay Pate
4-Oct-11 9:11am
View
I am trying to add SYSTEMDATETIEM and I have never done this in C++ but I have done this in SQL or ORACLE, there is something you can help me to get this done with C++ code I have sent you?
Thank you very much.
Vijay Pate
3-Oct-11 15:49pm
View
I dont have any experience and I am getting road block when assigning the value.
Thank you very much.
Vijay Pate
3-Oct-11 13:21pm
View
I need to add SystemDateTime or curentdatetime to Registry with this code.
Vijay Pate
29-Sep-11 9:20am
View
I am working on project require to get TIME DIFFERENT between two dates. I have software will expire in 30 days and I need to show on messagebox that end user has 30 days to 29 days and son as day passes. I have worked on following code to justify my work.
I also need to register this software with install date which will use as startDate and end date is 30 days which will give me SPANDATE any idea;
COleDateTimeSpan as follow:First Sets of code is for TIMESPAN:
COleDateTime timeStart; COleDateTime timeEnd;
COleDateTimeSpan timePassed;int daysLeft = 3;
timeStart = COleDateTime::GetCurrentTime(); // Date and time of the installation.
timeEnd = COleDateTime::GetCurrentTime();
timePassed = COleDateTime::GetCurrentTime() - timeStart;
daysLeft = 30 - static_cast<int>(timePassed.GetTotalDays());CString strMessage;
if (daysLeft > 3 && daysLeft <=3){
strMessage.Format("ADDapt was not activated within 30 days of \n"
"installation and currently not function. \n"
"To activate, please call Avtron Field Service \n""at 226-542-1230 ext 1214.\n"
"The %d" " days trial period started on the day you installed ADapt.\n"
"Do you want to Proceed?", daysLeft);}// AfxMessageBox(strMessage);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 226-542-1230 ext 1214. \n")
_T("Do you want to Proceed?"), daysLeft);/*
strMessage("You have 00%d" " days to activate ADDapt with valid license.", daysLeft);
*/}AfxMessageBox(strMessage, MB_OKCANCEL);
2nd sets of code is for registry entry but it is not working in VC++ 6.0 environment but it is working in VC++ version VS2010
using namespace System;using namespace System::Security::Permissions;
using namespace Microsoft::Win32;int main(){
// Create a subkey named Test9999 under HKEY_CURRENT_USER.
RegistryKey ^ test9999 = Registry::CurrentUser->CreateSubKey( "Test9999" );
// Create two subkeys under HKEY_CURRENT_USER\Test9999.
test9999->CreateSubKey( "TestName" )->Close();
RegistryKey ^ testSettings = test9999->CreateSubKey( "TestSettings" );
// Create data for the TestSettings subkey.
testSettings->SetValue( "Language", "French" );
testSettings->SetValue( "Level", "Intermediate" );
testSettings->SetValue( "ID", 123 ); testSettings->Close();
// Print the information from the Test9999 subkey.
Console::WriteLine( "There are {0} subkeys under Test9999.", test9999->SubKeyCount.ToString() );
array<string^>^subKeyNames = test9999->GetSubKeyNames();
for ( int i = 0; i < subKeyNames->Length; i++ ) {
RegistryKey ^ tempKey = test9999->OpenSubKey( subKeyNames[ i ] );
Console::WriteLine( "\nThere are {0} values for {1}.", tempKey->ValueCount.ToString(), tempKey->Name );
array<string^>^valueNames = tempKey->GetValueNames();
for ( int j = 0; j < valueNames->Length; j++ ) {
Console::WriteLine( "{0,-8}: {1}", valueNames[ j ], tempKey->GetValue( valueNames[ j ] )->ToString() );
} } // Delete the ID value.
testSettings = test9999->OpenSubKey( "TestSettings", true );
testSettings->DeleteValue( "id" ); // Verify the deletion.
Console::WriteLine( dynamic_cast<string^>(testSettings->GetValue( "id", "ID not found." )) );
testSettings->Close(); // Delete or close the new subkey.
Console::Write( "\nDelete newly created registry key? (Y/N) " );
if ( Char::ToUpper( Convert::ToChar( Console::Read() ) ) == 'Y' ) {
Registry::CurrentUser->DeleteSubKeyTree( "Test9999" );
Console::WriteLine( "\nRegistry key {0} deleted.", test9999->Name );
} else {
Console::WriteLine( "\nRegistry key {0} closed.", test9999->ToString() );
test9999->Close(); }}
Vijay Pate
22-Sep-11 15:33pm
View
when software get install I need installdate registered in REGEDIT(Registry) and take the date of install -1 every day till day 30 days over. messagebox mentione you have one less day goes for first Messagebox
and when software trial period will expire in 3 days left which will prompt customer to 2nd Messagebox and ask to upgrade the license by calling tech support.
Vijay Pate
22-Sep-11 8:30am
View
thank you very much
Vijay Pate
22-Sep-11 8:29am
View
I need to calculate how many days left before product or software expires. With this code I need to register this product in window registry with install date to determind when was product install and from that install date I need to determind 30 days .
Thank you very much.
Vijay Patel
Vijay Pate
21-Sep-11 14:57pm
View
I am working on project requires to find the TIMESPAN between software installation date and Software expiring date. I need software to pop up screen to calculate 30 days and it reduces as day has gone. As it is mentioned in first AfxMessageBox like:
{ 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 );
I need to show the days left in %d
Once the software reches 27th day I need software to view following Message :
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);
Once software expire from trial period I need to show security page which has Productcode which will activate the software
My biggest hurdle is to register this product in window registery and once the installdate is figured out then it is easy to work with
Thank you very much
Vijay Patel
feel free to call at 4.1.9.7.8.7.8.5.8.0
CODE I WORKED is as follow:
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
}
Vijay Pate
20-Sep-11 8:34am
View
either way I press ok or cancle it bring main form up.
Thank you for your prompt reply.
Vijay Pate
15-Sep-11 14:16pm
View
I also want to use installdate in REGISTRY and get teh date from registry to calculate how many days left before software expire, if that is available in VC++ 6.0
Vijay Pate
15-Sep-11 14:12pm
View
After installing this software I get first screen to mentioned enduser has 30 days as it is mentioned in::: strMessage.Format("ADDapt was not activated within 30 days of \n"
"installation and 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 ADapt.\n"
"Do you want to Proceed?", daysLeft);
After 25 days later that is 3days before software expire following message appear:::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 216 642-1230 ext 1214. \n")
_T("Do you want to Proceed?"), daysLeft);
But the value for %d never appear.
Thank you very much.
COleDateTime timeStart;
// COleDateTime timeEnd(30.0);
COleDateTimeSpan timePassed;
int daysLeft = 3;
timeStart = COleDateTime::GetCurrentTime(); // Date and time of the installation.
// timeEnd = timeStart + timePassed;
timePassed = COleDateTime::GetCurrentTime() - timeStart;
daysLeft = 30 - static_cast<int>(timePassed.GetTotalDays());
CString strMessage;
if (daysLeft > 0 && daysLeft <=3)
{
strMessage.Format("ADDapt was not activated within 30 days of \n"
"installation and 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 ADapt.\n"
"Do you want to Proceed?", daysLeft);
}
// AfxMessageBox(strMessage);
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 216 642-1230 ext 1214. \n")
_T("Do you want to Proceed?"), daysLeft);
Vijay Pate
15-Sep-11 12:09pm
View
I know it is not true it suppose to be
if (daysLeft > 0 && daysLeft <= 3) is I need but when I change the date in TOOLBAR other screen or AfxMessageBox is not appearing thats why I need to know how can I Store First Install date in Registry zand utilize registry date to determin how many days left before software expire from trial software.
Thank you very much.
Vijay Pate
14-Sep-11 9:14am
View
in if statement daysLeft <= 3 will bypass first Messagebox and jump to 2nd Messagebox with %d remains and no days will appear.
Please let me know if you can bring light to this code
Vijay Pate
14-Sep-11 9:09am
View
<= will not compile and it will not show me the days in %d in 2hd AfxMessageBox
Vijay Pate
12-Sep-11 11:37am
View
COleDateTime is not changing and if I am understanding correctly follwing statement : "You have %d days left to renew ADDapt Software.", daysLeft );
%d has to be change from 29 days to 28 and so on. and it dosent.
any comments.
Thank you very much.
Vijay Pate
8-Sep-11 9:18am
View
Dave you mentioned you have some code or comments :: I did not see anything .
Could you please mention more in detail.
Thank you.
Vijay Pate
7-Sep-11 16:17pm
View
I did not see any code format
Vijay Pate
2-Sep-11 10:53am
View
After Trial period expire I need MANU ITEM compltely inactive except Security tab has Log in info and Product activation code.
Any suggestion?
Thank you very much
Vijay Pate
2-Sep-11 7:50am
View
What actual meaning of this statement:
Also I would not put literal string in your code, place them in the resource file. This will make localization in the future a lot easier.
Vijay Pate
2-Aug-11 15:31pm
View
I am doing this to learn the process of C++,if I buy tha package then purpose of learning will go in vain.
Vijay Pate
1-Aug-11 7:32am
View
Thatraja,
I didnot see your upload topic could you please send me the link.
Thank you very much.
Vijay
Vijay Pate
29-Jul-11 6:52am
View
VB is not going to help I need this in C##### please
Vijay Pate
28-Jul-11 15:30pm
View
I need small example on UPLOAD AND DOWN LOAD FILE IN C# Win forms. which has one button and one text box once you upload or down load file show up in that text box
Vijay Pate
27-Jul-11 10:34am
View
any solution on line to find out "How much time remains" in Message box
Vijay Pate
27-Jul-11 10:21am
View
It has been 10 years and lost touch withVC++ 6.0
Vijay Pate
14-Jul-11 8:15am
View
Deleted
If Clause
if (m_dwProductCode == 0)
m_strAddapt98 = "Activation Required";
else
m_strAddapt98 = "Product Code Invalid";
m_strSA = "Purchase Required";
m_strViewer = "Purchase Required";
if (m_dwProductCode == 1)
m_strAddapt98 = "Available";
else
m_strAddapt98 = "Product Code valid";
m_strViewer = "Available";
}
THia is what you need me to do.
}
Vijay Pate
14-Jul-11 8:08am
View
Deleted
I am new to Old technology I have never used it and I was asked favor to this for somebody else.
Vijay Pate
13-Jul-11 13:21pm
View
Deleted
yes I am try to insert code where
*****************
if (m_dwProductCode == 0)
m_strAddapt98 = "Activation Required";
else
m_strAddapt98 = "Product Code Invalid";
m_strSA = "Purchase Required";
m_strViewer = "Purchase Required";
******************
If ProductCOde is correct then Purchase Required turn into "Available"
Thants what I am looking for.
Thank you very much
Vijay
Show More