开发者

Subclassing a control

Ok so i'm trying to subclass a ListView control. I'm using SetWindowLong(). Consider this code:

WNDPROC oldProc;

WNDPROC newProc(hwnd, msg, wparam, lparam) // not proper code, but you get the idea { // some code here }

MainProc(...) { oldProc = SetWindowLong(control_hwnd, GWL_WNDPROC, (LONG) &newproc); }

At the setwindowlong f开发者_运维技巧unction call, i'm getting a compiler error. error: address of overloaded function with no contextual type information

Yet as MSDN, their example is pretty much the same. What's wrong with my code?


It looks like the definition of newProc is incorrect. It should be:

LRESULT CALLBACK newProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
    // Some code here.
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜