Crash while creating ToolBar?
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7852
Printed Date: 13 November 2025 at 9:47am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Crash while creating ToolBar?
Posted By: prashant
Subject: Crash while creating ToolBar?
Date 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.
|
Replies:
Posted By: Oleg
Date 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
|
Posted By: prashant
Date 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); }
|
|