Hi,
I am newbie to PPC and VC++.
I have created one small PPC 2002 exe file(dialog based).I am adding two edit controls to take name and contact number. I am adding one list box too in the same dialog to show the list of the entries.
The problem is, when ever I close the application and restarts it, the list box is empty b'cos I am not storing the info any where.So,I am trying to store the list entries using registry or .INI file.
OnAdd() function, I need to do this.
As a test, I tried with sample data like this
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileString(LPCTSTR("mysection"
,LPCTSTR("myname"
,LPCTSTR("madhavi"
);
CString name = pApp->GetProfileString(LPCTSTR("mysection"
,LPCTSTR("myname"
);
AfxMessageBox(name);
when I run the code, blank message box is appearing.
Then, I came to know about SetRegistryKey() method.So, I added this code in InitDialog() method of the dialog
CWinApp* nApp = AfxGetApp();
nApp->SetRegistryKey(_T("nlt2"
);
I am getting this error,
Compiling...
nlt2Dlg.cpp
C:\EVC\myprojects\nlt2\nlt2Dlg.cpp(64) : error C2248: 'SetRegistryKey' : cannot access protected member declared in class 'CWinApp'
C:\Windows CE Tools\wce300\Pocket PC 2002\mfc\include\afxwin.h(4196) : see declaration of 'SetRegistryKey'
Error executing cl.exe.
can anyone please help me,
Thanks any advance,
I am newbie to PPC and VC++.
I have created one small PPC 2002 exe file(dialog based).I am adding two edit controls to take name and contact number. I am adding one list box too in the same dialog to show the list of the entries.
The problem is, when ever I close the application and restarts it, the list box is empty b'cos I am not storing the info any where.So,I am trying to store the list entries using registry or .INI file.
OnAdd() function, I need to do this.
As a test, I tried with sample data like this
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileString(LPCTSTR("mysection"
CString name = pApp->GetProfileString(LPCTSTR("mysection"
AfxMessageBox(name);
when I run the code, blank message box is appearing.
Then, I came to know about SetRegistryKey() method.So, I added this code in InitDialog() method of the dialog
CWinApp* nApp = AfxGetApp();
nApp->SetRegistryKey(_T("nlt2"
I am getting this error,
Compiling...
nlt2Dlg.cpp
C:\EVC\myprojects\nlt2\nlt2Dlg.cpp(64) : error C2248: 'SetRegistryKey' : cannot access protected member declared in class 'CWinApp'
C:\Windows CE Tools\wce300\Pocket PC 2002\mfc\include\afxwin.h(4196) : see declaration of 'SetRegistryKey'
Error executing cl.exe.
can anyone please help me,
Thanks any advance,