会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
日月当空,王者无敌
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
7
8
9
10
11
12
13
14
15
···
20
下一页
2019年7月5日
CStatic中保持图形比例不变,尽量填充控件空间的代码
摘要: 先获取控件的高、宽,然后获取图像的高、宽,测试需要调整高还是调整宽 void CImagePreviewStatic::DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/) { Unit units; CRect rect; if (m_img2 != NU
阅读全文
posted @ 2019-07-05 15:15 日月王
阅读(267)
评论(0)
推荐(0)
2019年7月4日
base64编解码的另外几个版本
摘要: #include "crypto/encode/base64.h" static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; st
阅读全文
posted @ 2019-07-04 09:32 日月王
阅读(890)
评论(1)
推荐(0)
2019年7月3日
一个简单的INI读写文件类,基于C++的模板编程实现,使用超级方便
摘要: GITHUB链接:https://github.com/brofield/simpleini 主体代码: /** @mainpage <table> <tr><th>Library <td>SimpleIni <tr><th>File <td>SimpleIni.h <tr><th>Author <
阅读全文
posted @ 2019-07-03 18:31 日月王
阅读(729)
评论(0)
推荐(0)
几个模拟OLE事件注册、调用的宏
摘要: 最近遇到一个要求,将原来的OCX控件,替换成直接的DLL调用。 遇到OLE的事件回调,写了三个宏,用于简化代码 #define OLE_ENVENT_IN_CLASS_ONE(event_name, func_ret_type, param_type , param_name) \ public:
阅读全文
posted @ 2019-07-03 10:15 日月王
阅读(316)
评论(0)
推荐(0)
2019年7月2日
base64编解码的两个函数(安全版本)
摘要: void base64_encode_s(const unsigned char *str, long inlen, std::string& outstr, long* lpBufLen) { long len; long str_len; //unsigned char *res; //std:
阅读全文
posted @ 2019-07-02 09:40 日月王
阅读(630)
评论(0)
推荐(0)
获取文件扩展名的几个函数
摘要: CString GetSuffix(CString strFileName) { return strFileName.Right(strFileName.GetLength()-strFileName.ReverseFind('.')-1); } std::string GetSuffix(con
阅读全文
posted @ 2019-07-02 09:35 日月王
阅读(400)
评论(0)
推荐(0)
Window下,在TEMP路径下生成一个临时文件名
摘要: BOOL GetFullTempFileName(const TCHAR* strPrefix, std::wstring& strFullName) { TCHAR strTempFolder[MAX_PATH]; TCHAR strTempFileName[MAX_PATH]; DWORD dw
阅读全文
posted @ 2019-07-02 09:34 日月王
阅读(550)
评论(0)
推荐(0)
字符串中的TOUPPER函数
摘要: std::string& str_toupper(std::string& s) { std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c){ return ::toupper(c); } // correct ); ret
阅读全文
posted @ 2019-07-02 09:34 日月王
阅读(740)
评论(0)
推荐(0)
字符串中的TRIM操作
摘要: std::string& ltrim(std::string& str, const std::string& chars = "\t\n\v\f\r "); std::string& rtrim(std::string& str, const std::string& chars = "\t\n\
阅读全文
posted @ 2019-07-02 09:33 日月王
阅读(403)
评论(0)
推荐(0)
BIN转换成HEX格式及HEX转换成BIN的两个函数接口
摘要: unsigned char HEX2BYTE(unsigned char hex_ch) { if (hex_ch >= '0' && hex_ch <= '9') { return hex_ch - '0'; } if (hex_ch >= 'a' && hex_ch <= 'f') { retu
阅读全文
posted @ 2019-07-02 09:31 日月王
阅读(1580)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
15
···
20
下一页
公告