|
解决了!
- //映射文件大小
- DWORD iFileSizeHigh = 0;
- DWORD iFileSizeLow = 0;
- #ifdef OS_WINCE
- m_hFile = CreateFileForMapping(wcsBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |FILE_FLAG_RANDOM_ACCESS,0);
- //取文件大小
- iFileSizeLow = GetFileSize(m_hFile, &iFileSizeHigh);
- #else
- m_hFile = CreateFile(wcsBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- //取文件大小
- iFileSizeLow = GetFileSize(m_hFile, &iFileSizeHigh);
- #endif
-
- if (m_hFile == INVALID_HANDLE_VALUE)
- {
- LOG_ERROR("OpenFile : CreateFile fail !");
- return false;
- }
- // 创建文件映射对象
- m_hFileMap = CreateFileMapping(m_hFile, NULL, PAGE_READONLY, iFileSizeHigh, iFileSizeLow, NULL);
复制代码
在WIN32里面iFileSizeHigh和iFileSizeLow可以为0.CE里面貌似不可以!
文件大小无变化还是100多M |
|