标题:在一个MFC项目里,在系统初始化的时候要做一些自己的初始化工作,这个,要在 ...
取消只看楼主
jiyuchonger
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-3-1
 问题点数:0 回复次数:0 
在一个MFC项目里,在系统初始化的时候要做一些自己的初始化工作,这个,要在哪里写代码?
如题,想在系统初始化的时候,做一点自己的初始化工作,看了一点网上的东西,感觉是放在这个函数里,不知道是不是这样,求指点。。。

BOOL CXXXXXXXApp::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

    CNetVideoDlg dlg;
    m_pMainWnd = &dlg;
    int 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;
}

搜索更多相关主题的帖子: MFC 系统 项目 代码 
2010-06-11 22:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-310021-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.135300 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved