我用VC做了一个系统,其中有一个登录界面,当输入用户名和密码后,点击进入后,我想在加载这一段时间做一个进度条,然后再进入主界面,请问这个怎么实现呀!!!谢谢了!!在线等!!!1

解决方案 »

  1.   

    最好给我一个实例好吗?谢谢了![email protected]
      

  2.   

    自己弄呗,先获取加载的总长度,然后读取加载的当前长度。在Timer里更新CProgressCtrl的位置就可以,很简单的呀。自己动手做一下就可以拉,不要偷懒,:)
      

  3.   

    BOOL CTest6App::InitInstance()
    {
    AfxEnableControlContainer(); // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.#ifdef _AFXDLL
    Enable3dControls(); // Call this when using MFC in a shared DLL
    #else
    Enable3dControlsStatic(); // Call this when linking to MFC statically
    #endif
    SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings();  // Load standard INI file options (including MRU) int nResponse;
    CLoginDlg logindlg;//登陆对话框 nResponse = logindlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    }
    if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    return FALSE;
    }
    CTest6Dlg   dlg; m_pMainWnd = &dlg;
    nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    } // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
    }然后重载CLoginDlg对话框的OnOK,在OnOK中添加判断用户名及密码的代码。
      

  4.   

    另外就是启动画面了。。参考
    http://www.vckbase.com/document/viewdoc/?id=513
    http://www.vckbase.com/document/viewdoc/?id=1125
      

  5.   

    还有个办法
    nResponse = logindlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    }
    if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    return FALSE;
    }在nResponse == IDOK下调用一个非模态的对话框
    这个对话框你可以设置成自己要的模式
    然后
    调用
    CMyDialog cc
    cc.create(…………)
    cc.showwindow(…………)
    sleep(3000)显示三秒钟,时间可以自己设
    然后
    cc.destoryWindow(…………)这样的话,那个显示出来的非模态对话框,可以停留三秒
    然后销毁,进入下面的主窗口显示hoho
    方法自己选好了
    用小三的那个启动画面简单点,而且有示例代码了,呵呵~