新手百分请问g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD,(HOOKPROC)JournalLogProc,HInstance,0)
新手百分请教g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD,(HOOKPROC)JournalLogProc,HInstance,0);
本人新手 请教大家 为什么我一用上句 vs2005就说:
error C2440: 'type cast ' : cannot convert from 'overloaded-function ' to 'HOOKPROC '
None of the functions with this name in scope match the target type
------解决方案--------------------
JournalLogProc这个函数是怎么声明的?是类的成员函数?
定义成static吧,比如:
static LRESULT CALLBACK CBTProc(
int nCode, // hook code
WPARAM wParam, // depends on hook code
LPARAM lParam // depends on hook code
);
------解决方案--------------------
如何定义全局变量
----------------------
这个...
========================================
一般,全局消息钩子要依赖于一个DLL才能够正常工作
例外:
WH_JOURNALPLAYBACK
WH_JOURNALRECORD
WH_KEYBOARD_LL
WH_MOUSE_LL
MSDN:
This hook is called in the context of the thread that installed it.
------解决方案--------------------
http://blog.sina.com.cn/u/476bbdb9010005fr
------解决方案--------------------
但是怎么试都不行
望高人指点
我是在mfc dlg中用的 可以么
可以,钩子的话,个人觉得是要多花点时间的:)
------解决方案--------------------
看你的意思还是函数原型声明错误了。
本人新手 请教大家 为什么我一用上句 vs2005就说:
error C2440: 'type cast ' : cannot convert from 'overloaded-function ' to 'HOOKPROC '
None of the functions with this name in scope match the target type
------解决方案--------------------
JournalLogProc这个函数是怎么声明的?是类的成员函数?
定义成static吧,比如:
static LRESULT CALLBACK CBTProc(
int nCode, // hook code
WPARAM wParam, // depends on hook code
LPARAM lParam // depends on hook code
);
------解决方案--------------------
如何定义全局变量
----------------------
这个...
========================================
一般,全局消息钩子要依赖于一个DLL才能够正常工作
例外:
WH_JOURNALPLAYBACK
WH_JOURNALRECORD
WH_KEYBOARD_LL
WH_MOUSE_LL
MSDN:
This hook is called in the context of the thread that installed it.
------解决方案--------------------
http://blog.sina.com.cn/u/476bbdb9010005fr
------解决方案--------------------
但是怎么试都不行
望高人指点
我是在mfc dlg中用的 可以么
可以,钩子的话,个人觉得是要多花点时间的:)
------解决方案--------------------
看你的意思还是函数原型声明错误了。