Print Page | Close Window

Switching Windows with Keypad Numbers

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10567
Printed Date: 30 September 2024 at 3:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Switching Windows with Keypad Numbers
Posted By: mrmathis
Subject: Switching Windows with Keypad Numbers
Date Posted: 08 May 2008 at 6:02pm
In 11.2.0 and 11.2.1, I can't switch windows in my MDI ribbon app using the numbers on the keypad.  That is, create a few windows, then hit Alt-V-S-enter then 0 or 1 or 2.  The numbers above the keyboard work fine.  This fails in the RibbonMDISample as well.  It just dings at me.  However, the samples work in 11.2.2 and 12.0. 
 
What's the difference?  Was it a bug or did the sample change the way it does something?  Is there anything I can do in 11.2.0 to make this work?


-------------
--Mike



Replies:
Posted By: Oleg
Date Posted: 09 May 2008 at 1:23am
Hi,
 
try add these lines in sources:
 
BOOL CXTPShortcutManager::CompareAccelKey(TCHAR chAccel, UINT wParam)
{
 if (wParam >= VK_NUMPAD0 && wParam <= VK_NUMPAD9)
  return (UINT)chAccel == (wParam + '0' - VK_NUMPAD0);
...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mrmathis
Date Posted: 13 June 2008 at 6:17pm
I tried that and am seeing crashes - if not on the first call, then on the second.  The call to CXTPShortcutManager::CompareAccelKey appears to being doing what is expected of it.  However, a few lines after it returns to CXTPCommandBar::OnKeyboardTipChar I get the crash in the call to OnKeyboardTip.  At that point, pTip->m_pOwner usually points to freed memory (0xfeeefeee). 
 
The stack is
 
  CObject::IsKindOf(0x070e17d4) C++
  AfxDynamicDownCast(0x070e17d4, 0x20fc7728) C++
  CXTPCommandBar::OnKeyboardTip(0x20fc5c78) C++
  CXTPCommandBar::OnKeyboardTipChar(0x00000062) C++
  CXTPCommandBar::OnHookKeyDown(0x00000062, 0x00500001) C++
  CXTPPopupBar::OnHookKeyDown(0x00000062, 0x00500001) C++
  CXTPCommandBar::OnHookMessage(0x00000000, 0x00000100, 0x00000062, 0x00500001, 0x00000000) C++
  CXTPKeyboardManager::ProcessKeyboardHooks(0x00000100, 0x00000062, 0x00500001) C++
  CXTPKeyboardManager::KeyboardProc(0x00000000, 0x00000062, 0x00500001) C++

 
I've tried debugging it to see how pOwner is going bad, but with breakpoints in place, the crash goes away.  I tried making the breakpoints conditional on the owner data looking wacky [eg (*((*pTip).m_pOwner)).m_dwRef < 0 || (*((*pTip).m_pOwner)).m_dwRef > 100].  Sometimes they fire, but other times I crash without the breakpoints firing.  In those cases the data doesn't look freed, but since I'm crashing something must be bad.
 
Any thoughts?
 


-------------
--Mike


Posted By: Oleg
Date Posted: 14 June 2008 at 5:18am
Hi,
Download 12.0 release.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net