void CLed::OnPaint() { CPaintDC dc(this); // device context for painting DrawLed(&dc,m_nLedColor,m_nLedMode,m_nLedShape); // Do not call CStatic::OnPaint() for painting messages }
/////////////////////////////////////////////////////////////////////////////// // Name: SetLed // Description: This method will draw and set led parameters. // // Entry: int iLedColor - Where color is defined by: // LED_COLOR_RED // LED_COLOR_GREEN // LED_COLOR_YELLOW // LED_COLOR_BLUE // // int iMode - where mode is defined by: // LED_ON // LED_OFF // LED_DISABLED // // int iShape - where shape is defined by: // LED_ROUND // LED_SQUARE /////////////////////////////////////////////////////////////////////////////// void CLed::SetLed(int nLedColor, int nMode, int nShape) { m_nLedColor = nLedColor; m_nLedMode = nMode; m_nLedShape = nShape; CDC *pDC; pDC = GetDC(); DrawLed(pDC,m_nLedColor,m_nLedMode,m_nLedShape); ReleaseDC(pDC); }