V
VickyCool4U
Guest
Hi Experts,
I had created a MFC extended dll in VS 2010 professional edition, where I derive a toolbar class from CToolBar.
And try to use the same resource in another dialog based(exe) application.
my code is given as follows:-
I had exported the whole CMyToolBar class in dll application already Mytoolbar.cpp:-
CMyToolBar::CMyToolBar(void)
{
}
CMyToolBar::~CMyToolBar(void)
{
}
void CMyToolBar::create(CWnd *hHandle)
{
if(!this->CreateEx(hHandle, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!this->LoadToolBar(IDR_MYTOOLBAR))
{
TRACE0("Failed to Create Dialog Toolbar\n");
}
}
exe code:- myDialog class:-
BOOL CSampleTestAppDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
CMyToolBar toolBar;
toolBar.create(this);
}
But the resource is not loaded in the dialog class.
Can you please suggest me, what is wrong here?
Continue reading...
I had created a MFC extended dll in VS 2010 professional edition, where I derive a toolbar class from CToolBar.
And try to use the same resource in another dialog based(exe) application.
my code is given as follows:-
I had exported the whole CMyToolBar class in dll application already Mytoolbar.cpp:-
CMyToolBar::CMyToolBar(void)
{
}
CMyToolBar::~CMyToolBar(void)
{
}
void CMyToolBar::create(CWnd *hHandle)
{
if(!this->CreateEx(hHandle, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!this->LoadToolBar(IDR_MYTOOLBAR))
{
TRACE0("Failed to Create Dialog Toolbar\n");
}
}
exe code:- myDialog class:-
BOOL CSampleTestAppDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
CMyToolBar toolBar;
toolBar.create(this);
}
But the resource is not loaded in the dialog class.
Can you please suggest me, what is wrong here?
Continue reading...