Fixed a BUG of VC++ 6.0
MSDN documentation states that for files larger th… Continue Reading Fixed a BUG of VC++ 6.0
感悟技术人生
MSDN documentation states that for files larger th… Continue Reading Fixed a BUG of VC++ 6.0
/********** cfile64.h *********/ class CFile64 : public CFile { public: // Attributes ULONGLONG GetPosition(); // Overridables virtual ULONGLONG Seek(LONGLONG lOff, UINT nFrom); virtual void SetLength(ULONGLONG dwNewLen); ULONGLONG GetLength() ; virtual void LockRange(ULONGLONG dwPos, ULONGLONG dwCount); virtual void UnlockRange(ULONGLONG dwPos, ULONGLONG dwCount); }; /*************** cfile64.cpp ***************/ #include "stdafx.h" #include "file64.h" // CFile64 implementation ULONGLONG CFile64::Seek(LONGLONG lOff, UINT nFrom) { ASSERT_VALID(this); ASSERT((HANDLE)m_hFile != INVALID_HANDLE_VALUE); ASSERT(nFrom == begin || nFrom == end || nFrom == current); ASSERT(begin == FILE_BEGIN && end == FILE_END && current == FILE_CURRENT); LARGE_INTEGER liOff; liOff.QuadPart = lOff; liOff.LowPart = ::SetFilePointer((HANDLE)m_hFile, liOff.LowPart, &liOff.HighPart, (DWORD)nFrom); if (liOff.LowPart == (DWORD)-1) if (::GetLastError() != NO_ERROR) CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); return liOff.QuadPart; } ULONGLONG CFile64::GetPosition() { ASSERT_VALID(this); ASSERT((HANDLE)m_hFile != INVALID_HANDLE_VALUE); LARGE_INTEGER liPos; liPos.QuadPart = 0; liPos.LowPart = ::SetFilePointer((HANDLE)m_hFile, liPos.LowPart, &liPos.HighPart , FILE_CURRENT); if (liPos.LowPart == (DWORD)-1) if (::GetLastError() != NO_ERROR) CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); return liPos.QuadPart; } void CFile64::LockRange(ULONGLONG dwPos, ULONGLONG dwCount) { ASSERT_VALID(this); ASSERT((HANDLE)m_hFile != INVALID_HANDLE_VALUE); ULARGE_INTEGER liPos; ULARGE_INTEGER liCount; liPos.QuadPart = dwPos; liCount.QuadPart = dwCount; if (!::LockFile((HANDLE)m_hFile, liPos.LowPart, liPos.HighPart, liCount.LowPart, liCount.HighPart)) { CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); } } void CFile64::UnlockRange(ULONGLONG dwPos, ULONGLONG dwCount) { ASSERT_VALID(this); ASSERT((HANDLE)m_hFile != INVALID_HANDLE_VALUE); ULARGE_INTEGER liPos; ULARGE_INTEGER liCount; liPos.QuadPart = dwPos; liCount.QuadPart = dwCount; if (!::UnlockFile((HANDLE)m_hFile, liPos.LowPart, liPos.HighPart, liCount.LowPart, liCount.HighPart)) { CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); } } void CFile64::SetLength(ULONGLONG dwNewLen) { ASSERT_VALID(this); ASSERT((HANDLE)m_hFile != INVALID_HANDLE_VALUE); Seek(dwNewLen, (UINT)begin); if (!::SetEndOfFile((HANDLE)m_hFile)) CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); } ULONGLONG CFile64::GetLength() { ASSERT_VALID(this); ULARGE_INTEGER liSize; liSize.LowPart = ::GetFileSize((HANDLE)m_hFile, &liSize.HighPart); if (liSize.LowPart == (DWORD)-1) if (::GetLastError() != NO_ERROR) CFileException::ThrowOsError((LONG)::GetLastError(), m_strFileName); return liSize.QuadPart; } /
LONGLONG是64位整型,这样在理论上可支持的最大文件为18000000000GB,你也可以根据自己的需要重载CFile的其他函数
本文出自:https://blog.csdn.net/jrt88/article/details/4392838/
RAD Studio11 提供了FireDAC连接数据库。关于 FDConnection 与数据库建… Continue Reading FireDAC数据库连接管理控件 TFDManager
扫雷最终完整版文件压缩包密码:6299660033338888
这里画了一个TFBS4711红外模组的转接板,用排针引出。其中IRTXD为发送数据引脚,接STM32… Continue Reading STM32 串口通讯 IrDA
最近在做一个项目,是对INFORMIX数据库的数据进行大数据分析,INFORMIX数据库数据有上亿条… Continue Reading informix 通过ADO或ODBC连接提取数据时出现中文乱码的解决方法
【FAQ】加密保护软件 WinLicense 注册常见问题解答(七) WinLicen… Continue Reading 【FAQ】加密保护软件 WinLicense 注册常见问题解答
**很多时候,Python爬取的文件都是写在TXT文本里,不过当要提取出来进行数据分析时无法按行输入… Continue Reading Python将txt文件内容转换成列表
用QT开发工具 使用方式: pro文件中 增加:QT += texttospeech 源文件中使用代… Continue Reading 将文本转换成语音的类
概述 本文主要是记录《VxWorks BSP Developer’s Guide 6.9… Continue Reading VxWorks 6.9 BSP开发指南