急!

解决方案 »

  1.   

    BOOL CRNToolsApp::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 // Change the registry key under which our settings are stored.
    // TODO: You should modify this string to be something appropriate
    // such as the name of your company or organization.
    SetRegistryKey(_T("RNTools")); LoadStdProfileSettings();  // Load standard INI file options (including MRU) // Register the application's document templates.  Document templates
    //  serve as the connection between documents, frame windows and views.         // 登陆矿
    CLoginDlg wndLoginDlg;
    if(wndLoginDlg.DoModal() == IDCANCEL)
    {
    return FALSE;
    }
             .........
    }
      

  2.   

    在视图内显示图片
    BOOL CSDIOutlookView::OnEraseBkgnd(CDC* pDC)
    {
    // TODO: 在此添加消息处理程序代码和/或调用默认值
        CRect rectbk;
        CBitmap bmbk;
    CDC dcMen;
        bmbk.LoadBitmap(IDC_CJ_LOGO);
        BITMAP stBitmap;
        bmbk.GetObject(sizeof(BITMAP),&stBitmap);
        CSize bmsize(stBitmap.bmWidth,stBitmap.bmHeight);
        dcMen.CreateCompatibleDC(pDC); 
        CBitmap *pold=dcMen.SelectObject(&bmbk);
        GetClientRect(&rectbk);
        pDC->StretchBlt(rectbk.left,rectbk.top,rectbk.Width(),rectbk.Height(),&dcMen,0,0,bmsize.cx,bmsize.cy,SRCCOPY);
        dcMen.SelectObject(pold);
        dcMen.DeleteDC();
        return true;
    }
      

  3.   

    至于显示图片,需要楼主好好学习CDC和CBitmap。不是一两句能说清除的。