网站首页  词典首页

请输入您要查询的计算机术语:

 

术语 CWinApp::WriteProfileString
释义 CWinApp::WriteProfileString

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

返回值:如果成功,则返回非零值;否则返回0。

参数:
lpszSection指向一个以null结尾的字符串,指定了包含入口的部分。如果这个部分不存在,就创建它。这个部分的名字对大小写不敏感,字符串可以是大写字符和小写字符的任意组合。
lpszEntry指向一个以null结尾的字符串,指定了包含要写入值的入口的部分。如果在指定的部分中不存在这个入口,就创建它。
lpszValue指向要写入的字符串。如果这个参数为NULL,则将删除lpszEntry指定的键。

说明:
调用这个函数将指定的字符串写入应用程序的注册表或INI文件的指定部分。
这些入口按如下方式保存:
·在Windows NT中,该值被保存在注册表中。
·在Windows 3.x中,该值被保存在WIN.INI文件中。
·在Windows 95中,该值被保存在WIN.INI的缓存版本中。

示例:
CString strSection = "My Section";
CString strStringItem = "My String Item";
CString strIntItem = "My Int Item";
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileString(strSection, strStringItem, "test");
CString strValue;
strValue = pApp->GetProfileString(strSection, strStringItem);
ASSERT(strValue == "test");
pApp->WriteProfileInt(strSection, strIntItem, 1234);
int nValue;
nValue = pApp->GetProfileInt(strSection, strIntItem, 0);
ASSERT(nValue == 1234);

请参阅:
CWinApp::GetProfileString, CWinApp::WriteProfileInt, ::WritePrivateProfileStringCWinApp::SetRegistryKey
随便看

 

MFC类库中文详解手册包含4274条MFC类库参考词条,基本涵盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容,是计算机编程的有利工具。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 12:30:41