Hola Leandro,
Private Sub DrawRectangle() seems to have a typo:
Private Sub DrawRectangle(hdc As Long, X As Long, Y As Long, Width As Long, Height As Long, oColor As OLE_COLOR)
Dim hPen As Long, OldhPen As Long
Dim OldBrush As Long
hPen = CreatePen(0, 1, oColor)
OldhPen = SelectObject(hdc, hPen)
OldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH))
Rectangle hdc, 0, 0, Width, Height
DeleteObject SelectObject(hdc, Height) ' MUST BE A TYPO. SHOULD BE DeleteObject SelectObject(hdc, OldhPen)?
Call SelectObject(hdc, OldBrush)
End Sub
Saludos,
TheWatcher