博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
BCG使用注意事项
阅读量:4198 次
发布时间:2019-05-26

本文共 2052 字,大约阅读时间需要 6 分钟。

BCGappWizard生成的应用程序特点:

1、在Stdafx.h中添加BCG的头文件

#include <BCGCBProInc.h>    // BCGPro Control Bar

2、应用程序类的派生方法:

class CDlgBarsApp : public CWinApp,

       public CBCGPWorkspace
{
public:
CDlgBarsApp();

…………

}

3、AfxEnableControlContainer():

You must call the AfxEnableControlContainer function when you use OLE control containers in Visual C++

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

:初始化COM库。

4、 BCGCBProCleanUp ():顾名思义吧,呵呵

对于模式对话框:

CDlgBarsDlg dlg;

m_pMainWnd = &dlg;
int nResponse = (int) 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
}

BCGCBProCleanUp ();

另外:可以在应用程序类的ExitInstance()中使用。防止BCG资源内存泄漏。

5、BCG软件例子无法修改编译,这是因为BCG界面库会自动写注册表,解决:

a、最笨,修改注册表

b、最简单,不让写注册表。在CxxxApp的InitInstance()中加入一句:m_bSaveState=FALSE;

BOOL CDlgBarsApp::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.

m_bSaveState = FALSE;

c、虽然写了,还可以这样:

int CXXXApp::ExitInstance()

{
BCGCBProCleanUp();
this->CleanState();
return CWinApp::ExitInstance();
}

转载地址:http://qouli.baihongyu.com/

你可能感兴趣的文章
magento---后台grid加载过程分析(二)-------edit grid-----news插件为例!
查看>>
自定义Magento系统配置
查看>>
输出出错信息!!
查看>>
js首页图片切换
查看>>
magento——后台导入产品数据注意的问题
查看>>
magento------tabs的分析和使用!!!
查看>>
低版本magento的一个session的bug
查看>>
wordpress-----后台设置URL出错后,登陆不了后台和前台的解决方法!!
查看>>
magento -- magento connect中我常用的key和magento网站收集
查看>>
后台的grid显示出来的功能模块步骤-----个人总结--12.28
查看>>
eidt——grid ---使用bar,和form空间!!!总结---12.28
查看>>
Edit_grid--编辑一个grid的步骤和分析(二)
查看>>
How to Get All Product Images in products list page?
查看>>
controller------forward——————解析!
查看>>
在模块中新建一个block作为自己的子block!!!!
查看>>
使用widget控件的一般规律!!!
查看>>
Magento中如何调用SQL语句------magento----摘来的其他不错的!
查看>>
关于傻逼(一)
查看>>
Magento的事件机制
查看>>
Magento – Rewrite 运行机制
查看>>