被要求把程序中用#define 定义的常量写成ini文件,那我该怎么写?直接把这部分copy到写字板,然后保存成.ini文件就可以了吗?另外,我在VC的stdafx.h文件里怎么调用呢?不会是#include "**.ini" 或者是import "*:\*\**.ini"吧?能教教我么?
解决方案 »
- CStrign是模板吗,怎么没用尖括号传递类型?
- 如何将listctrl中的内容导出到文本文件中?
- 关于tabctrl标签页位置的问题,谢谢回答
- 如何禁止树形控件的某个节点展开
- 在对话框中如何截取客户区的OnMouseMove消息并进行相应处理呢?
- 网络插头被拔下,vc编写的应用程序中如何立即得到消息和判断?
- 内嵌对象指针的问题!~~~
- 超难编译问题,并于MFC中的链编方式.
- 有关Virtual List
- 关于自制浏览器出现的问题(急急急)给50分
- 怎样设置Static标签,group上的字体的背景颜色?
- 请教微软专家:ATL项目中用CreateThread好,还是_beginthreadex好?
GetPrivateProfileString("TipFlag", "NOUSER", "", strMsg[1], 256, INIPATH);
GetPrivateProfileString("TipFlag", "REOK", "", strMsg[2], 256, INIPATH);
GetPrivateProfileString("TipFlag", "START", "", strMsg[3], 256, INIPATH);
GetPrivateProfileString("TipFlag", "RECANCEL", "", strMsg[4], 256, INIPATH);
GetPrivateProfileString("TipFlag", "HELP", "", strMsg[5], 256, INIPATH);
WritePrivateProfileString
具体使用看msdn
#define 定义的是常量,在编译期它得值就确定了。
如果放在ini中,只能是变量形式在程序运行后获得。
PASS = Both scanf and wscanf return the number of fields successfully !
NOUSER = does not include fields that were read but not assigned. A return value of 0
REOK = assigned. The return value is EOF for an error or if the end-of-file character
RECANCEL = given by argument. Each argument must be a pointer to a variable of a type that corresponds to a type specifier in format. If copying takes place
START = wscanf is a wide-character version of scanf; the format argument to wscanf is a wide-character string. wscanf and scanf behave identically otherwise.