Esempio n. 1
0
//“英文字符串”转换为“当前语言类型的字符串”
CString ConvertString(CString strText)
{
	char *val = new char[200];
	CString strIniPath,strRet;

	memset(val,0,200);
	GetPrivateProfileString("String", strText, "", val, 200, g_GetIniPath());
	strRet = val;
	if(strRet.GetLength()==0)
	{
		//如果ini文件中不存在对应的字符串,设置为默认值(英文)
		strRet=strText;
	}
	delete val;
	return strRet;
}
Esempio n. 2
0
char* ConvertInfo(char* strText)
{

	if(val!=NULL)
		delete val;
	val = new char[256];
	memset(val,0,256);
	GetPrivateProfileString("String",strText,"",
		val,256,g_GetIniPath());
	if(strlen(val)==0)
	{
		//If there is no corresponding string in ini file ,then set it to be default value.
		memcpy(val,strText, strlen(strText));
	}
	return val;
}
Esempio n. 3
0
CString ConvertString(CString strText)
{
	char *val = new char[200];
	CString strIniPath,strRet;
	
	memset(val,0,200);
	GetPrivateProfileString("String",strText,"",
		val,200,g_GetIniPath());
	strRet = val;
	if(strRet.GetLength()==0)
	{
		//If there is no corresponding string in ini file ,then set it to be default value.
		strRet=strText;
	}
	delete val;
	return strRet;
}