如果可以,请详细说明使用过程。
我将高分相送………………在线等待
☆☆☆☆☆☆☆☆☆☆☆☆☆☆

解决方案 »

  1.   

    up for me
    i have waiting the message for long time
      

  2.   

    很简单啊,用classwizard从CWinThread派生一个类,比如CUserThread,在它的InitInstance中创建窗口,比如:
    BOOL CUserThead::InitInstance()
    {
    CFrameWnd* pWnd=new CFrameWnd;
    pWnd->Create(NULL,"this is a test");
    pWnd->ShowWindow(SW_SHOWNORMAL);
             m_pMainWnd=pWnd;
    return TRUE;
    }
    然后就可以启动线程了:AfxBeginThread(RUNTIME_CLASS(CUserThead));
      

  3.   

    EMAIL:?
    给你发一个现成的工程
      

  4.   

    AfxBeginThread(RUNTIME_CLASS(CUserThead)); 届面线程
    AfxBeginThread((AFX_THREADPROC)(CUserThead)); 工作者线程
      

  5.   

    界面线程嘛,从CWinThread派生就行了,如何启动类似。
      

  6.   

    CWinThread* AfxBeginThread( AFX_THREADPROC pfnThreadProc, LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0, DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL );
    这个函数用于启用worker线程,看上去是十个参数,复杂至极,其实只有两个是我们要关心的
    pfnThreadProc 函数名称,用来启动线程
    pParam   任意4字节数值,用来传给新进程,它可以是个整数,或指针,或单纯只是个0
      

  7.   

    // th.cpp : Defines the entry point for the console application.
    //#include "stdafx.h"
    #include "th.h"#ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif/////////////////////////////////////////////////////////////////////////////
    // The one and only application objectCWinApp theApp;
    UINT ThreadFunc(LPVOID);using namespace std;int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
    {
    int nRetCode = 0; // initialize MFC and print and error on failure
    if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
    {
    // TODO: change error code to suit your needs
    cerr << _T("Fatal Error: MFC initialization failed") << endl;
    nRetCode = 1;
    }
    else
    {
    for(int i = 0; i < 5; i++)
    {
    if(AfxBeginThread(ThreadFunc, (LPVOID)i))
    printf("Thread launched %d\n", i);
    }
    //wait for the threads to complets
    Sleep(2000); return 0;
    } return nRetCode;
    }
    UINT ThreadFunc(LPVOID n)
    {
    for(int i = 0; i < 10; i++)
    printf("%d%d%d%d%d%d%d%d%d%d\n",n,n,n,n,n,n,n,n,n,n);
    return 0;
    }
      

  8.   

    结帖:
        在结帖前我要感谢所有给我很都好的意见的朋友们,所以只要来者都有分。
    在此我特别感谢发送EMAIL源代码给我的 librastar2001,提出好的意见的webber84 ,还有在其他帖子中给我很多帮助的nonocast。
        希望大家继续支持我……%……