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

C / C++ / MFC

 
AnswerRe: What type of view is VC++'s output window? Pin
Nish Nishant25-Nov-01 5:31
sitebuilderNish Nishant25-Nov-01 5:31 
AnswerRe: What type of view is VC++'s output window? Pin
Stephane Routelous25-Nov-01 16:34
Stephane Routelous25-Nov-01 16:34 
QuestionFree Source Code? Pin
Lizp25-Nov-01 2:46
Lizp25-Nov-01 2:46 
GeneralWeird Problem Pin
mvworld25-Nov-01 2:14
mvworld25-Nov-01 2:14 
GeneralRe: Weird Problem Pin
Nish Nishant25-Nov-01 5:21
sitebuilderNish Nishant25-Nov-01 5:21 
GeneralCView as a dialog box Pin
25-Nov-01 1:57
suss25-Nov-01 1:57 
QuestionWhat happens to the CDC Pin
25-Nov-01 1:45
suss25-Nov-01 1:45 
AnswerRe: What happens to the CDC Pin
Tim Deveaux25-Nov-01 3:45
Tim Deveaux25-Nov-01 3:45 
Salut Danielle

Yes, what happens is that the OnDraw is called from the OnPaint method, like so:

/////////////////////////////////////////////////////////////////////////////
// CView drawing support

void CView::OnPaint()
{
	// standard paint routine
	CPaintDC dc(this);
	OnPrepareDC(&dc);
	OnDraw(&dc);
}


The creation of the CPaintDC causes GetDC and BeginPaint to be called, and its destruction releases the DC and calls EndPaint for you. So the CDC that is passed to OnDraw is yours to work with without needing to release it.

However, unless you have created the view with a special window class that has the CS_OWNDC style (unlikely) you should not store the CDC* for use outside the context of OnDraw.

HTH
GeneralRe: What happens to the CDC Pin
2-Dec-01 0:40
suss2-Dec-01 0:40 
GeneralComboBox problem ! Pin
Hadi Rezaee25-Nov-01 1:34
Hadi Rezaee25-Nov-01 1:34 
GeneralRe: ComboBox problem ! Pin
Michael P Butler25-Nov-01 1:42
Michael P Butler25-Nov-01 1:42 
GeneralRe: ComboBox problem ! Pin
Hadi Rezaee25-Nov-01 1:51
Hadi Rezaee25-Nov-01 1:51 
GeneralRe: ComboBox problem ! Pin
Nish Nishant25-Nov-01 5:25
sitebuilderNish Nishant25-Nov-01 5:25 
GeneralDataGrid ! Pin
Hadi Rezaee25-Nov-01 1:25
Hadi Rezaee25-Nov-01 1:25 
GeneralRe: DataGrid ! Pin
Christian Graus25-Nov-01 10:19
protectorChristian Graus25-Nov-01 10:19 
GeneralRe: DataGrid ! Pin
Hadi Rezaee25-Nov-01 15:02
Hadi Rezaee25-Nov-01 15:02 
GeneralRe: DataGrid ! Pin
Christian Graus25-Nov-01 15:37
protectorChristian Graus25-Nov-01 15:37 
GeneralRe: DataGrid ! Pin
Hadi Rezaee25-Nov-01 15:48
Hadi Rezaee25-Nov-01 15:48 
GeneralRe: DataGrid ! Pin
Christian Graus25-Nov-01 16:00
protectorChristian Graus25-Nov-01 16:00 
GeneralRe: DataGrid ! Pin
Hadi Rezaee26-Nov-01 15:54
Hadi Rezaee26-Nov-01 15:54 
GeneralRe: DataGrid ! Pin
Christian Graus26-Nov-01 16:10
protectorChristian Graus26-Nov-01 16:10 
GeneralRe: DataGrid ! Pin
Hadi Rezaee28-Nov-01 2:25
Hadi Rezaee28-Nov-01 2:25 
GeneralRe: DataGrid ! Pin
Carlos Antollini28-Nov-01 2:40
Carlos Antollini28-Nov-01 2:40 
GeneralRe: DataGrid ! Pin
Hadi Rezaee28-Nov-01 6:49
Hadi Rezaee28-Nov-01 6:49 
GeneralDelete folder error, please help me! Pin
Huu Quynh25-Nov-01 0:18
Huu Quynh25-Nov-01 0:18 

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.