CWinApp::WriteProfileString

BOOL WriteProfileString ( LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszValue );

戻り値

成功した場合は 0 だ。そうでなければ 0。

パラメーター

lpszSection

エントリを含むセクションを指定します、null で終わる文字列へのポインター。セクションが存在しない場合は、それが作成されます。セクションの名前は独立した場合です。文字列は大文字と小文字があります。

lpszEntry

値に書き込まれるエントリが含まれている null で終わる文字列へのポインター。エントリに指定したセクションが存在しない場合は、それが作成されます。

lpszValue

書き込む文字列へのポインター。このパラメーターがNULLの場合は、 lpszEntryパラメーターで指定したエントリが削除されます。

解説

アプリケーションのレジストリの指定したセクションに指定した文字列を記述するにはこのメンバー関数を呼び出しますか。INI ファイル。

エントリは次のとおりに保存されます。:

特価;CString strSection =「私」;CString strStringItem =「My 文字列項目」;CString strIntItem =「マイ Int 項目」;CWinApp ※ パップ = AfxGetApp();パップ - > WriteProfileString (strSection、strStringItem、"test");CString strValue;strValue = パップ - > GetProfileString (strSection、strStringItem);ASSERT (strValue =「テスト」);パップ - > WriteProfileInt (strSection、strIntItem、1234年);int nValue;nValue パップ-= > GetProfileInt (strSection、strIntItem、0);ASSERT(nValue == 1234)


CWinApp の概要|nbsp;クラス メンバー |階層図(&N)

参照特価;CWinApp::GetProfileStringCWinApp::WriteProfileInt :: WritePrivateProfileStringCWinApp::SetRegistryKey(&N)

Index