惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - format

使用Arduino Nano驱动Lora模块 DIY一个物联网平台:想法 jQuery 批量操作checkbox 国内的maven镜像 Python Flask UnicodeDecodeError 编码错误解决 关于Python的web框架 NHibernate 3 中的 In 集合查询 在MVC 4 中使用自定义Membership [学习][Java] Struts2 与页面传值 (转) C++ Utf8字符转换Gb312编码,解决TinyXml中文乱码 Linux学习 -- Linux的可执行文件 WIN32简单的窗体代码,带函数功能注释 WINSocket编程 发生HTTP GET请求,并接收服务器返回 Win32 API 的文件操作 - format Win32编程 创建从资源文件定义的对话框 Oracle 数据库 用脚本建表空间 把UserControl通过代码控制输入HTML WebService调用时候的Object Moved 异常 ICTCLAS 平台调用的封装
C++ 类中封装Win32API的回调函数
format · 2010-06-02 · via 博客园 - format

一定要把方法声明成为静态方法,这样才能取到函数的地址。

例如:

这样什么回调函数:

static INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

在用的时候需要取地址:

this->hWnd=CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), NULL, &FormatDlg::About);

我所理解的需要静态方法的原因:只有静态方法才能在编译时候取到固定的函数地址,如果是动态的是在运行时产生地址不固定,所以一定要用静态方法。