| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 645 人关注过本帖
标题:在一个MFC项目里,在系统初始化的时候要做一些自己的初始化工作,这个,要在 ...
只看楼主 加入收藏
jiyuchonger
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-3-1
收藏
 问题点数:0 回复次数:2 
在一个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
bowengo
Rank: 2
等 级:论坛游民
帖 子:13
专家分:25
注 册:2010-5-23
收藏
得分:0 
最后是创建自己的类,然后重载初始化的函数
2010-06-12 09:36
zgxyz2008
Rank: 4
等 级:业余侠客
帖 子:67
专家分:202
注 册:2008-10-28
收藏
得分:0 
InitInstance()初始化同一个应用程序的多个副本或“实例”;
OnInitDialog()初始化对话框.
2010-06-12 12:44
快速回复:在一个MFC项目里,在系统初始化的时候要做一些自己的初始化工作,这个 ...
数据加载中...
 
   



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

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