Click here to Skip to main content
15,907,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 17:22
George_George19-Mar-08 17:22 
GeneralRe: Virtual function design pattern Pin
followait19-Mar-08 18:00
followait19-Mar-08 18:00 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 18:30
George_George19-Mar-08 18:30 
GeneralIs it not safe to use RectF::Equals? (float comparison problem) [modified] Pin
followait18-Mar-08 19:10
followait18-Mar-08 19:10 
GeneralRe: Is it not safe to use RectF::Equals? (float comparison problem) Pin
Mark Salsbery18-Mar-08 20:05
Mark Salsbery18-Mar-08 20:05 
Questionnot installaing visual studio .Net 2003 in vista? Pin
rowdy_vc++18-Mar-08 18:55
rowdy_vc++18-Mar-08 18:55 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
Naveen18-Mar-08 19:18
Naveen18-Mar-08 19:18 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
Rajesh R Subramanian18-Mar-08 22:05
professionalRajesh R Subramanian18-Mar-08 22:05 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
David Crow19-Mar-08 4:23
David Crow19-Mar-08 4:23 
GeneralStructure array initialization error Pin
LiYS18-Mar-08 18:53
LiYS18-Mar-08 18:53 
GeneralRe: Structure array initialization error Pin
Naveen18-Mar-08 19:08
Naveen18-Mar-08 19:08 
QuestionRe: Structure array initialization error Pin
ThatsAlok18-Mar-08 20:00
ThatsAlok18-Mar-08 20:00 
QuestionHow to show a bitmap in a CStatic control? Pin
fantasy121518-Mar-08 17:55
fantasy121518-Mar-08 17:55 
GeneralRe: How to show a bitmap in a CStatic control? Pin
Naveen18-Mar-08 18:31
Naveen18-Mar-08 18:31 
GeneralRe: How to show a bitmap in a CStatic control? Pin
MANISH RASTOGI18-Mar-08 18:35
MANISH RASTOGI18-Mar-08 18:35 
QuestionRe: How to show a bitmap in a CStatic control? Pin
fantasy121518-Mar-08 19:11
fantasy121518-Mar-08 19:11 
GeneralRe: How to show a bitmap in a CStatic control? Pin
Mark Salsbery18-Mar-08 20:14
Mark Salsbery18-Mar-08 20:14 
QuestionRe: How to show a bitmap in a CStatic control? Pin
fantasy121518-Mar-08 20:26
fantasy121518-Mar-08 20:26 
GeneralRe: How to show a bitmap in a CStatic control? Pin
Mark Salsbery18-Mar-08 20:35
Mark Salsbery18-Mar-08 20:35 
fantasy1215 wrote:
Can I draw the bitmap in the CStatic control just in the CAboutDlg class? And how?


You can, but there's a slight problem.

Getting a dc to the client or window area of the control is no problem.
That makes drawing simple.

The problem is when to draw.

You can draw any time you want to, but you also need to draw in response to WM_PAINT,
to refresh windows overdrawn in instances like when the user drags another window over
the top of yours then moves it away.

From the dialog (parent) window's WM_PAINT handler, there's no reliable way I know of to
know when the child windows are finished drawing themselves, at which time it would be safe
to draw on top of them.


MFC does subclassing for you, and makes handling the messages consistent regardless of
window/control class, so it's definitely IMO the easier way to go.

Besides, painting from the window class itself instead of from a window's parent class
just makes for a better object-oriented implementation.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionRe: How to show a bitmap in a CStatic control? Pin
Rajkumar R18-Mar-08 19:25
Rajkumar R18-Mar-08 19:25 
GeneralGetting the value when u point to a particular position Pin
Chandrasekharan P18-Mar-08 16:43
Chandrasekharan P18-Mar-08 16:43 
GeneralRe: Getting the value when u point to a particular position Pin
Steve Echols18-Mar-08 19:30
Steve Echols18-Mar-08 19:30 
GeneralRe: Getting the value when u point to a particular position Pin
ThatsAlok18-Mar-08 19:56
ThatsAlok18-Mar-08 19:56 
Questioncan DirectSound and DirectShow work at the same time? Pin
mwolf12218-Mar-08 15:57
mwolf12218-Mar-08 15:57 
AnswerRe: can DirectSound and DirectShow work at the same time? Pin
Mark Salsbery18-Mar-08 16:28
Mark Salsbery18-Mar-08 16:28 

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.