Introduction
The Windows API of accessing INI file cannot support UNICODE FILE, for instance, if someone wants to write a Chinese string into an INIFILE and read it in a Japanese system, he will not get the correct string.
So, I wrote a class to access INIFILE in UNICODE. You can use it as using Win API. This class provides such interfaces:
static INT GetPrivateProfileInt(
LPCWSTR lpAppName, LPCWSTR lpKeyName, INT nDefault, LPCWSTR lpFileName );
static DWORD GetPrivateProfileSection(
LPCWSTR lpAppName, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName );
static DWORD GetPrivateProfileSectionNames(
LPWSTR lpszReturnBuffer, DWORD nSize, LPCWSTR lpFileName );
static DWORD GetPrivateProfileString(
LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize, LPCWSTR lpFileName );
static BOOL WritePrivateProfileSection(
LPCWSTR lpAppName, LPCWSTR lpString, LPCWSTR lpFileName );
static BOOL WritePrivateProfileString(
LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpString, LPCWSTR lpFileName );
static BOOL WritePrivateProfileInt(
LPCWSTR lpAppName, LPCWSTR lpKeyName, INT nValue, LPCWSTR lpFileName );
History
- 26th September, 2006: Initial post