您的位置:首页 > 编程语言 > PHP开发

GetPrivateProfileString读取INI配置文件信息

2011-04-02 15:48 676 查看
CString CConfigPro::GetConfigValue(CString strAppName, CString strKeyName)

{

TCHAR szValue[MAX_PATH];
CString strCurrentPath, strConfigPath, strValue;
GetModuleFileName(NULL, strCurrentPath.GetBufferSetLength(MAX_PATH+1), MAX_PATH);
strCurrentPath.ReleaseBuffer();
int nPosIndex = strCurrentPath.ReverseFind('//');
strConfigPath = strCurrentPath.Left(nPosIndex) + _T("//Config.ini");
GetPrivateProfileString(strAppName, strKeyName, _T(""), szValue, MAX_PATH, strConfigPath);
strValue = szValue;
return strValue;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ini path null