抛弃GdCpp*.dll/pdb历史重新建库。libhv和Sqlite的dll保留

This commit is contained in:
Zhang Jianjun
2026-02-02 16:09:02 +08:00
parent f148ca49e3
commit 4a2a284ac0
292 changed files with 350450 additions and 0 deletions

44
include/CWinErr.h Normal file
View File

@@ -0,0 +1,44 @@
#ifndef CWINERR_H
#define CWINERR_H
#include "GdCPP_Exports.h"
#include <stdint.h>
#include <xstring>
GDCPP_API wchar_t* getWinErrString(DWORD winErrCode);
GDCPP_API DWORD getWinErrString(DWORD winErrCode, wchar_t* lpMsgBuf, DWORD nSize);
class GDCPP_API CWinErr
{
public:
CWinErr(uint32_t bufsize=1024)
: bufSize(bufsize)
{
pMsg = new wchar_t[bufSize];
}
~CWinErr()
{
delete [] pMsg;
}
/// 记录Windows API执行出错后用GetLastError()获取的错误码。
uint32_t errCode=0;
wchar_t* pMsg = nullptr;
uint32_t bufSize = 0;
DWORD GetLastError()
{
errCode = ::GetLastError();
return getWinErrString(errCode, pMsg, bufSize);
}
DWORD WSAGetLastError()
{
errCode = ::WSAGetLastError();
return getWinErrString(errCode, pMsg, bufSize);
}
};
#endif // CWINERR_H