The problem is I don't want to write any details into the ini file. I just want to create an ini file in the current directory or in another e.g. in the debug folder where the main .exe is.
//CIniWriter iniWriter("Logger.ini");
void CIniWriter::Init(char* szFileName)
{
memset(m_szFileName, 0x00, 255);
memcpy(m_szFileName, szFileName, strlen(szFileName));
}
Any idea on how to do this?
Call GetCurrentDirectory
to get the path of your application then
CreateFile
to create the actual file.
TCHAR currentDir[MAX_PATH];
TCHAR iniFile[MAX_PATH];
GetCurrentDirectory( MAX_PATH, currentDir );
_stprintf(iniFile,_T("%s\\iniFile.txt"),currentDir);
HANDLE hFile = CreateFile( iniFile,GENERIC_WRITE, FILE_SHARE_READ,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);