Click here to Skip to main content
16,008,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Important Points for KT Pin
Cedric Moonen10-Jun-10 8:11
Cedric Moonen10-Jun-10 8:11 
GeneralRe: Important Points for KT Pin
Richard MacCutchan10-Jun-10 5:43
mveRichard MacCutchan10-Jun-10 5:43 
GeneralRe: Important Points for KT Pin
Niklas L11-Jun-10 2:09
Niklas L11-Jun-10 2:09 
GeneralRe: Important Points for KT Pin
Richard MacCutchan11-Jun-10 2:44
mveRichard MacCutchan11-Jun-10 2:44 
GeneralRe: Important Points for KT Pin
Tim Craig10-Jun-10 13:48
Tim Craig10-Jun-10 13:48 
GeneralRe: Important Points for KT Pin
CPallini10-Jun-10 3:00
mveCPallini10-Jun-10 3:00 
QuestionProblem in redrawing Rectangle on "Up Arrow Key Down" in MFC Dialog Based application Pin
Arindam Tewary9-Jun-10 23:55
professionalArindam Tewary9-Jun-10 23:55 
AnswerRe: Problem in redrawing Rectangle on "Up Arrow Key Down" in MFC Dialog Based application Pin
Aescleal10-Jun-10 0:14
Aescleal10-Jun-10 0:14 
You need to understand how WM_PAINT and OnPaint works. If you call your OnPaint at an arbitrary time what happens is it creates a CPaintDC which won't (or rather probably won't) have any invalid region in it. So all your drawing is clipped to a non-existent region and nothing appears on the screen.

Try calling Invalidate() instead of OnPaint() and see if that improves the situation. Can't remember the parameters off the top of me head so you'll have to look them up! This signals that you want to paint the whole window and will cause a redraw (i.e. your OnPaint()) will get called indirectly. When that happens CPaintDC will be set up properly.

Oh, and only have one object of type CPaintDC in a given OnPaint method, you might get some strangeness otherwise.

Cheers,

Ash
AnswerRe: Problem in redrawing Rectangle on "Up Arrow Key Down" in MFC Dialog Based application Pin
CPallini10-Jun-10 0:26
mveCPallini10-Jun-10 0:26 
GeneralRe: Problem in redrawing Rectangle on "Up Arrow Key Down" in MFC Dialog Based application Pin
Arindam Tewary10-Jun-10 0:38
professionalArindam Tewary10-Jun-10 0:38 
GeneralRe: Problem in redrawing Rectangle on "Up Arrow Key Down" in MFC Dialog Based application Pin
CPallini10-Jun-10 1:02
mveCPallini10-Jun-10 1:02 
Questioncatching new Pin
Sakhalean9-Jun-10 22:56
Sakhalean9-Jun-10 22:56 
AnswerRe: catching new Pin
rp_suman9-Jun-10 23:19
rp_suman9-Jun-10 23:19 
GeneralRe: catching new Pin
Sakhalean9-Jun-10 23:27
Sakhalean9-Jun-10 23:27 
GeneralRe: catching new Pin
rp_suman10-Jun-10 6:00
rp_suman10-Jun-10 6:00 
AnswerRe: catching new Pin
Aescleal9-Jun-10 23:25
Aescleal9-Jun-10 23:25 
GeneralRe: catching new Pin
Sakhalean9-Jun-10 23:28
Sakhalean9-Jun-10 23:28 
GeneralRe: catching new Pin
Aescleal9-Jun-10 23:43
Aescleal9-Jun-10 23:43 
GeneralRe: catching new Pin
Sakhalean10-Jun-10 0:22
Sakhalean10-Jun-10 0:22 
GeneralRe: catching new Pin
Stephen Hewitt10-Jun-10 14:07
Stephen Hewitt10-Jun-10 14:07 
QuestionPopup Menu Pin
VVVimal9-Jun-10 22:37
VVVimal9-Jun-10 22:37 
AnswerRe: Popup Menu Pin
Niklas L9-Jun-10 22:54
Niklas L9-Jun-10 22:54 
AnswerRe: Popup Menu Pin
rp_suman9-Jun-10 22:59
rp_suman9-Jun-10 22:59 
QuestionRe: Popup Menu Pin
David Crow10-Jun-10 3:04
David Crow10-Jun-10 3:04 
Question#import vbe6ext.olb causing a problem Pin
T21029-Jun-10 22:23
T21029-Jun-10 22:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.