UINT ThreadFunc(LPVOID p)
{
PostThreadMessage(WM_HTTP_SEND, 0 ,0);
//
return 0;
}Compiling...
HttpSpeedExDlg.cpp
F:\Media\xml\HttpSpeedEx\HttpSpeedExDlg.cpp(183) : error C2660: 'PostThreadMessageA' : function does not take 3 parameters
Error executing cl.exe.
Creating browse info file...为什么老是出现这样的错误
我想在线程里面发消息 请问我该怎么做

解决方案 »

  1.   

    The PostThreadMessage function posts a message to the message queue of the specified thread. It returns without waiting for the thread to process the message. BOOL PostThreadMessage(
      DWORD idThread, // thread identifier
      UINT Msg,       // message
      WPARAM wParam,  // first message parameter
      LPARAM lParam   // second message parameter
    );楼主你用错函数了,应该是PostMessage
      

  2.   

    你的线程函数是一个全局的函数,在全局线程函数中使用PostMessage应该使用API 函数中的PostMessage函数,不应该使用CWnd中的PostMessage成员函数,API中的PostMessage原形如下
    BOOL PostMessage(          
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam
    );
    这个函数的第一个参数是目标窗口的句柄!在线程函数中使用时应该使用如下方式 
    ::PostMessage(hwnd,........);
    hwnd是目标窗口的句柄!希望对你有所帮助!
      

  3.   

    可以用afxgetmainhwmd->postmessage()
    就可以了