在动态连接库里调用sendmessage报错:
global functions do not have 'this' pointers。应该怎么解决呢?我用窗口指针pWnd->sendmessage()也不行。谢谢。

解决方案 »

  1.   

    开始用的就是::SendMessage(),后来不行才改的pWnd->sendmessage()。结果都是一样的。一样的错误。
      

  2.   

    代码如下:LRESULT _declspec(dllexport) CALLBACK KeyProc(int code,WPARAM wParam,LPARAM lParam)
    {
    if(hwnd&&code==HC_ACTION) 

    if(lParam&0x80000000) 

    char *c; 
    *c=wParam; 
    COPYDATASTRUCT Data;
    Data.cbData=1;
    Data.lpData=(void *)c;
    ::SendMessage(hwnd,WM_COPYDATA,(WPARAM)this,(LPARAM)&Data);
    }
    }
    return CallNextHookEx(hKHook,code,wParam,lParam);
    }
      

  3.   

    sorry sorry,我看到了,我把别处的代码直接拷过来也没细看。我知道哪错了。
    谢谢各位