Why do you need to get a DC ? You can only draw in the OnPaint, and in it you need to declare
Code:
CPaintDC dc(this);
to create a DC. Drawing outside the OnPaint is simply the wrong way to do it.