Download
prjUnicodeIni_V2012_0403_2211.rar
srcUnicodeIni-2013-1010-1923.rar
// srcUnicodeIni.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "UnicodeIni/UnicodeIni.h" #define G_INI_PATHNAME L"c:\\testUnicodeini.ini" #define G_INI_SECTION_NAME L"SectionName1" #define G_INI_KEY_NAME L"KeyName1" #define G_INI_KEY_VALUE_DEFAULT L"" #define G_INI_KEY_VALUE_LEN_MAX 4096 int _tmain(int argc, _TCHAR* argv[]) { BOOL bRc = TRUE; DWORD dwRc = 0; CONST DWORD dwLenKeyValue = G_INI_KEY_VALUE_LEN_MAX; TCHAR cKeyValue[dwLenKeyValue]; CUnicodeIni ini(G_INI_PATHNAME, TRUE); bRc = ini.WriteProfileString(G_INI_SECTION_NAME, G_INI_KEY_NAME, L"KeyValue1"); if(!bRc) { _tprintf(L"ERROR ini.WriteProfileString %s = %d\n", L"::GetLastError()", ::GetLastError()); goto _tmain_END; } dwRc = ini.GetProfileString(G_INI_SECTION_NAME, G_INI_KEY_NAME, G_INI_KEY_VALUE_DEFAULT, cKeyValue, dwLenKeyValue); if(dwRc >= dwLenKeyValue) { _tprintf(L"ERROR ini.GetProfileString, KeyValue need %d bytes\n", dwRc); goto _tmain_END; } _tmain_END: getchar(); return 0; }