FILE *pfIniPathName ;
if( (pfIniPathName = fopen(g_fIniPathName , "r")) == NULL )
{
wsprintf(strtmp,"%s%s",gWorkingPath,"CCDAdjust.ini");
WritePrivateProfileString("Action", "IniPathName", "CCDAdjust.ini" , strtmp);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
}
else
{
fclose(pfIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
GetPrivateProfileString("Action" , "IniPathName" , "CCDAdjust.ini" , (char*)sIniName,64,(char*)g_fIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,sIniName);
}
请结合以上代码帮我详细介绍一下以下函数的功能和各个形参表示的意思
wsprintf();
GetprivateProfileString
fopen()
WritePrivateProfileString
谢谢!!!
if( (pfIniPathName = fopen(g_fIniPathName , "r")) == NULL )
{
wsprintf(strtmp,"%s%s",gWorkingPath,"CCDAdjust.ini");
WritePrivateProfileString("Action", "IniPathName", "CCDAdjust.ini" , strtmp);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
}
else
{
fclose(pfIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
GetPrivateProfileString("Action" , "IniPathName" , "CCDAdjust.ini" , (char*)sIniName,64,(char*)g_fIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,sIniName);
}
请结合以上代码帮我详细介绍一下以下函数的功能和各个形参表示的意思
wsprintf();
GetprivateProfileString
fopen()
WritePrivateProfileString
谢谢!!!
解决方案 »
- GDI怎么方便地绘制定制的直线???
- 急急急急 vc6.0或vc.net 如何做com组件(上传组件) 在线等待 进者都有分 贡献出我所有分
- 基于对话框的MFC程序,在线等大侠!!
- 请问如何获得一个表中有哪些字段!!?
- 如何获取windows桌面上的鼠标事件。
- 用纯C++开发ActiveX控件时读写文件出错
- createdispatch失败的原因
- 关于窗口切分的问题
- 类的静态成员函数问题,,,,,,MFC基于对话框的程序;
- 怎样解决这个连接问题?
- 奇怪问题,要求置顶,win32 Dynamic-link library 连接 sybase 数据库的问题,详细请进http://community.csdn.net/Expert/TopicView3.asp
- 如何实现这种界面阿?
fopen打开文件,wspintf向文件的格式化输出。
fopen用来打开文件
wsprintf()用来“拼”字符串。具体请察看msdn。
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
LPCTSTR lpString,
LPCTSTR lpFileName
);
其中各参数的意义:
LPCTSTR lpAppName 是INI文件中的一个字段名.
LPCTSTR lpKeyName 是lpAppName下的一个键名,通俗讲就是变量名.
LPCTSTR lpString 是键值,也就是变量的值,不过必须为LPCTSTR型或CString型的.
LPCTSTR lpFileName 是完整的INI文件名.其他函数的参数意义也差不多的
if( (pfIniPathName = fopen(g_fIniPathName , "r")) == NULL ) {
//合并字符串到strtmp
wsprintf(strtmp,"%s%s",gWorkingPath,"CCDAdjust.ini");
//把strtmp的内容写到.ini文件中
// [Action]
// IniPathName = strtmp
WritePrivateProfileString("Action", "IniPathName", "CCDAdjust.ini" , strtmp);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
}
else
{
fclose(pfIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,"CCDAdjust.ini");
GetPrivateProfileString("Action" , "IniPathName" , "CCDAdjust.ini" , (char*)sIniName,64,(char*)g_fIniPathName);
wsprintf(g_fIniPathName,"%s%s",gWorkingPath,sIniName);
}