CFile...
来源:互联网 发布:java中io与nio的差异 编辑:程序博客网 时间:2024/06/04 18:09
今天学会了CFile对象,原来MFC里面文件读写的方法有那么多的。还有用C++I/O的方法的。
不过,文档/视图类的交互,还有CFileDialog和做成文件读写的程序还没有.
另外,读取网络内容变成控件的内容也要学学...
还有,今天也知道了JavaScript的一些使用技巧。呵呵...
重要的是CFile的对象生成(lpszFileName),然后用CFile::Open来打开,再建立一个char的数组缓冲区,用CFile::Read来将读到的Byte放进去。
用.和用->是差不多的,不过一个是指针(-> & *),一个没有而已(.)。
这个问题还要弄明白!!!
-------------------------------
清除IE的历史记录的函数
#include <wininet.h>
#include <UrlHist.h>
#include <shlguid.h>
#include <objbase.h>
ClearHistory()
{
CoInitialize(NULL);
IUrlHistoryStg2 *pUrlHistoryStg2 = NULL;
HRESULT hr = CoCreateInstance(CLSID_CUrlHistory,NULL,1,IID_IUrlHistoryStg2,(LPVOID *)&pUrlHistoryStg2);
if(SUCCEEDED(hr))
{
pUrlHistoryStg2->ClearHistory();
pUrlHistoryStg2->Release();
}
CoUninitialize();
}
----------------------------------------
CFile Class Members
Data Members
m_hFile Usually contains the operating-system file handle.Construction
CFile Constructs a CFile object from a path or file handle. Abort Closes a file ignoring all warnings and errors. Duplicate Constructs a duplicate object based on this file. Open Safely opens a file with an error-testing option. Close Closes a file and deletes the object.Input/Output
Read Reads (unbuffered) data from a file at the current file position. ReadHuge Can read more than 64K of (unbuffered) data from a file at the current file position. Obsolete in 32-bit programming. See Read. Write Writes (unbuffered) data in a file to the current file position. WriteHuge Can write more than 64K of (unbuffered) data in a file to the current file position. Obsolete in 32-bit programming. See Write. Flush Flushes any data yet to be written.Position
Seek Positions the current file pointer. SeekToBegin Positions the current file pointer at the beginning of the file. SeekToEnd Positions the current file pointer at the end of the file. GetLength Retrieves the length of the file. SetLength Changes the length of the file.Locking
LockRange Locks a range of bytes in a file. UnlockRange Unlocks a range of bytes in a file.Status
GetPosition Retrieves the current file pointer. GetStatus Retrieves the status of this open file. GetFileName Retrieves the filename of the selected file. GetFileTitle Retrieves the title of the selected file. GetFilePath Retrieves the full file path of the selected file. SetFilePath Sets the full file path of the selected file.Static
Rename Renames the specified file (static function). Remove Deletes the specified file (static function). GetStatus Retrieves the status of the specified file (static, virtual function). SetStatus Sets the status of the specified file (static, virtual function).- CFile...
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile
- CFile类
- CFile详解
- CFile源码
- CFile m_fileTestLog;
- 从今天开始用上了液晶显示器,总算对得起自己的眼睛了。感谢!
- "连连看"算法笔记
- Oracle函数速查
- 连连看算法
- 在应用程序中操作注册表
- CFile...
- 加菲猫语录精选
- 用SQL添加附加数据库
- 夏新WinCE IPTV领跑数字化生活
- [经典文章(转载)]一个美国老工程师的心理话: 给年轻工程师的十大忠告
- pages.scp15-29,汉化好了!不过有两千五百多条呢!
- ASP防SQL注入攻击程序
- 刘仪伟经典语录摘
- 微软建议的ASP性能优化28条守则