![]() |
Crash while creating ToolBar? |
Post Reply
|
| Author | |
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
Topic: Crash while creating ToolBar?Posted: 22 August 2007 at 10:23am |
|
Hi Oleg,
I am getting crash following call:- >> CToolBarViewName is derived from CXTPToolBar >> Also I added following lines in .h and .cpp file respectively. DECLARE_DYNAMIC(CToolBarViewName) IMPLEMENT_DYNAMIC(CToolBarViewName ,CXTPToolBar) CToolBarViewName *m_wndToolBar; Following Line of code CRASHING: m_wndToolBar = (CToolBarViewName*)pCommandBars->Add(_T("View"), xtpBarTop, RUNTIME_CLASS(CToolBarViewName )); 2) I need to handle PreTranslateMessage of my Toolbar class CToolBarViewName. Thanks in advance. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 August 2007 at 12:40pm |
|
instead DECLARE_DYNAMIC, IMPLEMENT_DYNAMIC use DECLARE_XTP_COMMANDBAR, IMPLEMENT_XTP_COMMANDBAR,
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2007 at 2:18am |
|
Hurrray
![]() Problem solved, thanks. I am able to trap WM_KEYDOWN message for all other keys except ENTER Not able to trap VK_RETURN message, my code is as follows BOOL CToolBarSearch::PreTranslateMessage(MSG *pMsg) { if( pMsg->message == WM_KEYDOWN ) { switch(pMsg->wParam) {// Send Message to parent // Informing user Enter Key case VK_RETURN: m_pParent->SendMessage(WM_COMMAND, (WPARAM)MSG_MYMSG,0); break; } } return TToolBar::PreTranslateMessage(pMsg); } |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |