CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jul 2005
    Posts
    266

    SetWindowsHookEx - Without Creating DLL

    Well i am sorry but i am trying to add a hook using SetWindowsHookEx
    so here is what i have
    Myproc:
    Code:
    LRESULT CALLBACK ChookDlg::MyPrc(int nCode,WPARAM wParam,LPARAM lParam){//...}
    and my function
    Code:
    g_hHook=SetWindowsHookEx(WH_GETMESSAGE,(HOOKPROC)&ChookDlg::MyPrc,NULL,dwID);
    when i try to compile it gives me an error
    error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'HOOKPROC'
    None of the functions with this name in scope match the target type
    I don't know what to do
    Hmm i saw somewhere that it needs to be static but i need to use some variables of this ChookDlg and i can't (
    Last edited by kolkoo; October 6th, 2005 at 02:39 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured