We help IT Professionals succeed at work.

VK_COMMA in VC++ 6

dann555
dann555 asked
on
Medium Priority
691 Views
Last Modified: 2013-11-20
I get this error:
error C2065: 'VK_COMMA' : undeclared identifier

I tried to replace VK_COMMA with the literal ',' and the ASCII value 44 but the system seems to not recognize
the key combination Alt + ','

This is how my code looks like:

void CBUNI_MyCtrl::OnKeyDownEvent(USHORT nChar, USHORT nShiftState)
{
    bool bIsShiftDown = ((nShiftState & SHIFT_MASK) > 0);
    bool bIsAltDown = ((nShiftState & ALT_MASK) > 0);
    bool bIsCtrlDown = ((nShiftState & CTRL_MASK) > 0);
     
    if((nChar == ',' || nChar == 44) && bIsAltDown && !bIsShiftDown && !bIsCtrlDown)
    {
       // can't go in here
       ...
    }
}

Does anyone know how to get around this?

Thanks.
Comment
Watch Question

Commented:
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
     if ( MapVirtualKey( nChar, 2)     == ',' )
      {
         // here some processing if comma
      }
     CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}

I hope the code above will help you.
Make shure that the window has the focus.

Author

Commented:
thanks, BogdyPtr !!!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.