Problem using ON_UPDATE_COMMAND_UI_RANGE macro

Using VC6, MDI application:
Problem: not seeing correct nID number, in the resource ID_COLOR_BLACK = 32775 when I step through the program the nID number is 1244612.

Thanks in advance.


void CSketcherDoc::ColorSel(CCmdUI* pCmdUI, UINT nID)
{
switch (nID)
{
case ID_COLOR_BLACK:
pCmdUI->SetCheck(m_Color == BLACK);
break;

case ID_COLOR_RED:
pCmdUI->SetCheck(m_Color == RED);
break;

case ID_COLOR_GREEN:
pCmdUI->SetCheck(m_Color == GREEN);
break;

case ID_COLOR_BLUE:
pCmdUI->SetCheck(m_Color == BLUE);
break;

}
}


With:
BEGIN_MESSAGE_MAP(CSketcherDoc, CDocument)
//{{AFX_MSG_MAP(CSketcherDoc)
ON_COMMAND(ID_COLOR_BLACK, OnColorBlack)
ON_COMMAND(ID_COLOR_BLUE, OnColorBlue)
ON_COMMAND(ID_COLOR_GREEN, OnColorGreen)
ON_COMMAND(ID_COLOR_RED, OnColorRed)
ON_COMMAND(ID_ELEMENT_CIRCLE, OnElementCircle)
ON_COMMAND(ID_ELEMENT_CURVE, OnElementCurve)
ON_COMMAND(ID_ELEMENT_LINE, OnElementLine)
ON_COMMAND(ID_ELEMENT_RECTANGLE, OnElementRectangle)
//}}AFX_MSG_MAP
ON_UPDATE_COMMAND_UI_RANGE(ID_ELEMENT_LINE, ID_ELEMENT_CURVE,ElementSel)

ON_UPDATE_COMMAND_UI_RANGE(ID_COLOR_BLACK, ID_COLOR_BLUE, ColorSel)
END_MESSAGE_MAP()

And:
afx_msg void ElementSel(UINT nID);
afx_msg void ColorSel(CCmdUI* pCmdUI, UINT nID);


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories