Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Switching Windows with Keypad Numbers
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Switching Windows with Keypad Numbers

 Post Reply Post Reply
Author
Message
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Topic: Switching Windows with Keypad Numbers
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2008 at 5:18am
Hi,
Download 12.0 release.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.