Click here to Skip to main content
16,010,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem reading file in C++ newbie here ;) Pin
David Crow4-Jun-07 7:32
David Crow4-Jun-07 7:32 
GeneralRe: problem reading file in C++ newbie here ;) Pin
GatoFedorento4713-Jun-07 7:33
GatoFedorento4713-Jun-07 7:33 
GeneralRe: problem reading file in C++ newbie here ;) Pin
David Crow13-Jun-07 7:44
David Crow13-Jun-07 7:44 
GeneralRe: problem reading file in C++ newbie here ;) Pin
GatoFedorento4713-Jun-07 7:48
GatoFedorento4713-Jun-07 7:48 
QuestionRe: problem reading file in C++ newbie here ;) Pin
David Crow13-Jun-07 7:29
David Crow13-Jun-07 7:29 
Questionwhat is the secret of stepping through an stepping over MFC application ? Pin
Software_Specialist3-Jun-07 10:43
Software_Specialist3-Jun-07 10:43 
AnswerRe: what is the secret of stepping through an stepping over MFC application ? Pin
Christian Graus3-Jun-07 11:20
protectorChristian Graus3-Jun-07 11:20 
QuestionHow to populate a CBitmap correctly Pin
C. Tam3-Jun-07 9:46
C. Tam3-Jun-07 9:46 
What is the correct way to populate a CBitmap object from a CDC object in the function below?
How should the return object be release properly in order to avoid resource leakage?

<br />
// Type declaration<br />
CStatic	m_picture;<br />
WMPPlayer4 m_player;<br />
<br />
// Function caller<br />
CBitmap bm_copy;<br />
CopyWindowAreaToStatic( CWindowDC( &m_player ), bm_copy );<br />
<br />
// Function definition<br />
// <br />
void CopyWindowAreaToStatic( CDC& cdc_source, CBitmap& bm_copy )<br />
{<br />
  // Display source onto m_picture<br />
  CClientDC dc_static( &m_picture );<br />
  CRect rc_static;<br />
  m_picture.GetClientRect( rc_static );<br />
  dc_static.BitBlt( 0, 0, rc_static.Width(), rc_static.Height(), &cdc_source, 0, 0, SRCCOPY );<br />
<br />
  // Return source via bm_copy<br />
  CSize sc(rc_static.Width(), rc_static.Height());<br />
  bm_copy.CreateCompatibleBitmap(&cdc_source, sc.cx, sc.cy);<br />
}<br />

AnswerRe: How to populate a CBitmap correctly Pin
Naveen3-Jun-07 16:01
Naveen3-Jun-07 16:01 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam3-Jun-07 18:29
C. Tam3-Jun-07 18:29 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen3-Jun-07 18:34
Naveen3-Jun-07 18:34 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam3-Jun-07 21:02
C. Tam3-Jun-07 21:02 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen3-Jun-07 21:07
Naveen3-Jun-07 21:07 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam4-Jun-07 0:36
C. Tam4-Jun-07 0:36 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen4-Jun-07 14:01
Naveen4-Jun-07 14:01 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam5-Jun-07 15:57
C. Tam5-Jun-07 15:57 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen5-Jun-07 16:00
Naveen5-Jun-07 16:00 
GeneralRe: How to populate a CBitmap correctly [modified] Pin
C. Tam5-Jun-07 20:05
C. Tam5-Jun-07 20:05 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen6-Jun-07 13:10
Naveen6-Jun-07 13:10 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam6-Jun-07 15:56
C. Tam6-Jun-07 15:56 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen6-Jun-07 15:59
Naveen6-Jun-07 15:59 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam6-Jun-07 19:38
C. Tam6-Jun-07 19:38 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen6-Jun-07 19:55
Naveen6-Jun-07 19:55 
GeneralRe: How to populate a CBitmap correctly Pin
C. Tam7-Jun-07 15:28
C. Tam7-Jun-07 15:28 
GeneralRe: How to populate a CBitmap correctly Pin
Naveen7-Jun-07 16:39
Naveen7-Jun-07 16:39 

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.