VC如何操作.ini配置文件?是哪个类?
解决方案 »
- C++里一个关于CFileNameOK()覆盖的问题?
- Win7支持VS2005么?
- vs2005 编译 下面这段代码出现内存泄漏,为什么在输出窗口看不到内存泄漏的文件名和行号呢? 请大虾指点
- 用SendMessage发送消息时,想传递一个自定义类型的变量怎么办?
- MFC的listctrl删除元素时要按顺序吗?我有时一删会连续删几个。。。
- 在 CXxxApp中,如何得到单文档的CView实例?(或者指针?)
- 多文档的菜鸟问题。
- 请求帮忙
- 请教:我的记事本打不开txt类型的文件了。
- 请问哪儿有MSN Messenger 的SDK?
- 请问像金山影霸那样拖进去就能放的功能是怎样实现的?
- 一个For VC 6.0 的AddIn, Free.
GetProfileInt:
Retrieves an integer from an entry in the application’s .INI file.
WriteProfileInt:
Writes an integer to an entry in the application’s .INI file.
参见MSDN
UINT GetProfileInt(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
INT nDefault // default value if key name not found
);
UINT GetPrivateProfileInt(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
INT nDefault, // return value if key name not found
LPCTSTR lpFileName // initialization file name
);DWORD GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);BOOL WritePrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpString, // string to add
LPCTSTR lpFileName // initialization file
);