会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
leochan007
博客园
首页
新随笔
联系
订阅
管理
[置顶]
c++_成员函数回调
摘要: // #include <vcl.h> #pragma hdrstop #include "Unit1.h" // #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; class CAppleDemo { publi
阅读全文
posted @ 2020-10-21 15:36 leochan007
阅读(184)
评论(0)
推荐(0)
2026年5月13日
MFC截图
摘要: void CaptureWindow(HWND hWnd, CString strFilePath) { CRect rect; ::GetWindowRect(hWnd, &rect); // 获取窗口位置和大小(包括边框) HDC hWindowDC = GetWindowDC(hWnd); H
阅读全文
posted @ 2026-05-13 14:03 leochan007
阅读(4)
评论(0)
推荐(0)
2026年5月12日
日志显示函数名
摘要: #include <iostream> #include <cstdarg> #include <cstdio> #include <memory> // LogImpl 只负责输出最终字符串(不再处理 format + va_list) void LogImpl(const char* messa
阅读全文
posted @ 2026-05-12 17:02 leochan007
阅读(2)
评论(0)
推荐(0)
2026年4月24日
定义标志位
摘要: #include <iostream> // 定义标志位 #define FLAG_A (1 << 0) // 0000 0001 #define FLAG_B (1 << 1) // 0000 0010 #define FLAG_C (1 << 2) // 0000 0100 #define FL
阅读全文
posted @ 2026-04-24 17:46 leochan007
阅读(3)
评论(0)
推荐(0)
2025年5月26日
c++void*与map强转
摘要: #include <iostream> #include <map> int main() { std::map<int, int> myMap = { {1, 100}, {2, 200}, {3, 300} }; void* ptr = &myMap; // 安全转换 + 检查 if (!ptr
阅读全文
posted @ 2025-05-26 11:17 leochan007
阅读(27)
评论(0)
推荐(0)
2025年1月23日
获取1.5小时之前的代码
摘要: #include <iostream> #include <chrono> #include <ctime> #include <iomanip> #include <sstream> int main() { // 获取当前时间点 auto now = std::chrono::system_cl
阅读全文
posted @ 2025-01-23 16:36 leochan007
阅读(32)
评论(0)
推荐(0)
2024年12月27日
变量名变成字符串
摘要: #define STRINGIFY(x) #x int someVariable = 10; std::cout << STRINGIFY(someVariable) << " = " << someVariable << std::endl;
阅读全文
posted @ 2024-12-27 11:37 leochan007
阅读(16)
评论(0)
推荐(0)
2024年12月24日
时间字符串比较大小
摘要: #include <iostream> #include <sstream> #include <iomanip> #include <ctime> bool compareTimeStrings(const std::string& timeStr1, const std::string& tim
阅读全文
posted @ 2024-12-24 15:47 leochan007
阅读(51)
评论(0)
推荐(0)
2024年12月12日
二进制输出
摘要: #include <stdio.h> void print_binary(unsigned int n) { for (int i = sizeof(n) * 8 - 1; i >= 0; i--) { printf("%d", (n >> i) & 1); } printf("\n"); } vo
阅读全文
posted @ 2024-12-12 17:51 leochan007
阅读(21)
评论(0)
推荐(0)
2024年3月20日
mfc进程方面处理
摘要: // 获取某个进程ID DWORD GetTaskManagerProcessId() { DWORD taskManagerProcessId = 0; PROCESSENTRY32 pe32; pe32.dwSize = sizeof(PROCESSENTRY32); HANDLE hProce
阅读全文
posted @ 2024-03-20 17:48 leochan007
阅读(34)
评论(0)
推荐(0)
2024年2月18日
computed
摘要: Computed properties are unique data types that will reactively update only when the source data used within the property is updated. By defining a dat
阅读全文
posted @ 2024-02-18 08:57 leochan007
阅读(68)
评论(0)
推荐(0)
下一页
公告