المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to Load toolBar in CView? [modified]



C++ Programming
04-06-2009, 09:51 PM
Hi,

I got Class A which is derived from CView, and I would like to load ToolBar "ToolBar1" which already exists to that view.

int CAView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
m_wndBar.Create(GetParentFrame( ));
m_wndBar.LoadToolBar(IDR_BAR);

return 0;
}

Why does the above code crashes and causes assertion failure?
Any idea?

Thanks

sft

modified on Monday, April 6, 2009 1:47 PM