在com接口函数中,用_beginthread开启新线程不成功,求教怎么解决?

解决方案 »

  1.   

    只开了一个线程,现在怀疑com接口函数是不是不支持多线程..
      

  2.   

    CAdd* g_pAdd = NULL;CAdd::CAdd()
    {
    g_pAdd = this;
    }void FireExecution(void* lpvoid)
    {
    ::MessageBox(NULL,szPoint,NULL,1);
    g_pAdd->Fire_ExecutionOver(6);
    ::MessageBox(NULL,"after",NULL,1);
    }STDMETHODIMP CAdd::Add(int a, int b)
    {
    // TODO: Add your implementation code here_beginthreadex(NULL,0,(unsigned(__stdcall*)(void*))FireExecution,NULL,0,NULL); return S_OK;
    }
    贴上源代码,线程FireExecution中,两个message都能正常弹出,在两个messagebox之间的函数执行进入不了,不知道为什么?类指针g_pAdd也是有效的。