I'm programming with eVC++ 4 and have the following problem:
My program should use an INI file to read and write several values. To read/write I will use the functions GetProfileString and WriteProfileString (class CWinApp). But each call of this functions failed.
I use the following code (exactly like MSDN and eVC++ helpfile) :
BOOL CMyApp::InitInstance()
{
free((void*) m_pszProfileName );
m_pszProfileName = _tcsdup(_T("/Temp/COMConn.ini"));
// SetRegistryKey("MyApp");
// LoadStdProfileSettings();
....
}
void CDlgClass::ReadIniFile()
{
CString csValue;
....
AfxGetApp()->WriteProfileString(_T("Connect"), // Section
_T("Name"), // Key
_T("MyConnect") ); // Value to write
csValue = AfxGetApp()->GetProfileString(_T("Connect"), // Section
_T("Name"), // Key
_T("Error") ); // Default
....
}
The ini file /Temp/COMConn.ini exists, but each call of WriteProfileString() returns FALSE and each call of GetProfileString() returns "Error".
Why failed every access ?
Please help me (fast).
Thank You
Rico
I know that Windows CE 3.0 doesn't support ini-file functions
(GetProfileString/WriteProfileString functions reads/writes informations in
registry instead of a file). I don't know for PPC 2003.
-Chris
"Rico Salfer" <anon...@discussions.microsoft.com> wrote in message
news:07B59E4F-9D0A-4AE9...@microsoft.com...
> Hi,
>
> I'm programming with eVC++ 4 and have the following problem:
>
> My program should use an INI file to read and write several values. To
read/write I will use the functions GetProfileString and WriteProfileString
(class CWinApp). But each call of this functions failed.
>
> I use the following code (exactly like MSDN and eVC++ helpfile) :
>
> BOOL CMyApp::InitInstance()
> {
> free((void*) m_pszProfileName );
> m_pszProfileName = _tcsdup(_T("/Temp/COMConn.ini"));
>
> // SetRegistryKey("MyApp");
> // LoadStdProfileSettings();
> ...
> }
>
> void CDlgClass::ReadIniFile()
> {
> CString csValue;
>
> ...
> AfxGetApp()->WriteProfileString(_T("Connect"), // Section
> _T("Name"), // Key
> _T("MyConnect") ); // Value
to write
>
> csValue = AfxGetApp()->GetProfileString(_T("Connect"), // Section
> _T("Name"), //
Key
> _T("Error") );
// Default
>
> ...
> }
>
>
Paul T.
"Kirk" <NO SPAM> wrote in message
news:40163db1$0$19288$626a...@news.free.fr...