Click here to Skip to main content
15,897,137 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralOpaque COleClientItem Pin
Kyudos18-Mar-08 13:30
Kyudos18-Mar-08 13:30 
GeneralConverting int to string Pin
J_E_D_I18-Mar-08 9:19
J_E_D_I18-Mar-08 9:19 
GeneralRe: Converting int to string Pin
Maxwell Chen18-Mar-08 9:27
Maxwell Chen18-Mar-08 9:27 
GeneralRe: Converting int to string Pin
Mark Salsbery18-Mar-08 9:41
Mark Salsbery18-Mar-08 9:41 
GeneralRe: Converting int to string Pin
Joe Woodbury18-Mar-08 15:57
professionalJoe Woodbury18-Mar-08 15:57 
GeneralRe: Converting int to string Pin
ThatsAlok18-Mar-08 19:59
ThatsAlok18-Mar-08 19:59 
QuestionIs it okay to cast from int to unsigned char *? Pin
ChemmieBro18-Mar-08 8:54
ChemmieBro18-Mar-08 8:54 
AnswerRe: Is it okay to cast from int to unsigned char *? Pin
Mark Salsbery18-Mar-08 9:04
Mark Salsbery18-Mar-08 9:04 
GeneralRe: Is it okay to cast from int to unsigned char *? Pin
ChemmieBro18-Mar-08 9:20
ChemmieBro18-Mar-08 9:20 
GeneralRe: Is it okay to cast from int to unsigned char *? Pin
Mark Salsbery18-Mar-08 9:24
Mark Salsbery18-Mar-08 9:24 
GeneralRe: Is it okay to cast from int to unsigned char *? Pin
ChemmieBro18-Mar-08 9:36
ChemmieBro18-Mar-08 9:36 

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.