MFC中的多个工具栏 [英] Multiple toolbars in MFC

查看:75
本文介绍了MFC中的多个工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为MFC应用程序创建一个其他工具栏.

我将此添加到MainFrm.cpp

I need to create an additional toolbar for my MFC application.

I added this to MainFrm.cpp

if (!m_wndToolBar2.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | 
CBRS_LEFT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar2.LoadToolBar(IDR_MAINFRAME2))
{
TRACE0("Failed to create toolbar\n");
return -2; // fail to create
}



当我尝试运行程序时,出现以下错误:

"Windows已在MyApp.exe中触发了一个断点.
这可能是由于堆损坏导致的,这表明MyApp.exe或其已加载的任何DLL中都有错误.
这也可能是由于用户在MyApp.exe具有焦点时按了F12.
输出窗口可能包含更多诊断信息."

任何帮助都将非常有用.



when i try to run the program, I recieve the following error:

"Windows has triggered a breakpoint in MyApp.exe.
This may be due to a corruption of the heap, which indicates a bug in MyApp.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while MyApp.exe has focus.
The output window may have more diagnostic information."

Any help would be great.

推荐答案

请检查
您的第二个栏确实具有唯一的ID:)
Please check
that your second bar does take an unique ID :)


这篇关于MFC中的多个工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆