none
用户界面线程的问题 RRS feed

  • 问题

  • 我在主线程中创建一个用户界面线程,用户界面线程去创建一个对话框窗口,
    用的函数是:
    AfxBeginThread(RUNTIME_CLASS(CUi), 0, 0, NULL);
    这个函数是同是同时运行一个线程类,在线程类中的创建了一个非模态对话框,
    我想把主线程中的结构体对象传到对话框类中,但是
    AfxBeginThread(RUNTIME_CLASS(CUi), 0, 0, NULL)这个函数没有参数可以传递结构体的对象,我该怎样传递?
    xiao
    2010年12月27日 14:11

答案

  • http://msdn.microsoft.com/en-us/library/s3w9x78e(v=VS.100).aspx

    if you want to initialize any member data of the CWinThread object, such as m_bAutoDelete or any members of your derived class, before the thread starts running. Once your initialization is complete, use CWinThread::ResumeThread to start the thread running. The thread will not execute until CWinThread::ResumeThread is called.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • 已标记为答案 wh_xiao 2010年12月28日 1:19
    2010年12月27日 23:33
    版主