
Originally Posted by
VictorN
Could you show your updated code?
Are you still trying to call ANSI functions in your UNICODE applications?
What is the relationships between your updated structure and those ANSI functions calls?
The class I'm using to read the ini is called CSimpleIni from here http://code.jellycan.com/simpleini/. Using this, I can eliminate the ANSI function calls in the program.
It's usage is pretty simple:
Code:
TCHAR iniFile[MAXPATH];
const TCHAR *pszRet;
// skipping code to set iniFile...
CSimpleIni ini(TRUE, FALSE, FALSE);
SI_Error rc = ini.LoadFile(iniFile);
pszRet = ini.GetValue(_T("MTLAUNCH"), _T("DataPath"), path);
m_CfgData.DataPath = pszRet;
I added the const to the declaration of pszRet after the cast was brought to my attention.
The struct is now declared as:
Code:
struct IniData
{
CString DataPath;
int DrvType;
int DrvPort;
CString ConfigPath;
CString MapPath;
CString PinNamePath;
CString SocketPath;
CString CalPath;
CString clrBackground;
CString clrGrid;
int MeasureSpec;
int SuperMeasure;
IniData() : DrvType(0), DrvPort(0), MeasureSpec(0), SuperMeasure(0) {}
};
Bill