版主 我实际上用的就是POST 不过是先从Doc调用Mainfrm里的函数POSTMESSAGE

解决方案 »

  1.   

    If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.
    把主窗口的Hwnd记录下来传到线程里
      

  2.   

    跟AfxGetMainWnd 有关啊?我试试   不过另外还有个串口通讯线程 没传递Hwnd过去 也完全可以正常运行哎  CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
        ASSERT(pMain);
      

  3.   

    跟版主说的一样 把Hwnd传到线程里就解决了,原来这段话就是msdn里的,原本以为AfxGetMainWnd这么简单 没什么花头呢