Click here to Skip to main content
16,014,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Environment macro Pin
Rome Singh13-Sep-04 5:12
Rome Singh13-Sep-04 5:12 
GeneralRe: Environment macro Pin
Andrew Walker13-Sep-04 12:52
Andrew Walker13-Sep-04 12:52 
QuestionWarning: no message line prompt for ID *???? Pin
jettocrack12-Sep-04 6:13
jettocrack12-Sep-04 6:13 
AnswerRe: Warning: no message line prompt for ID *???? Pin
Ravi Bhavnani12-Sep-04 7:13
professionalRavi Bhavnani12-Sep-04 7:13 
GeneralProblem Regarding Tree in DOTNET Pin
eshban28412-Sep-04 6:08
eshban28412-Sep-04 6:08 
GeneralRe: Problem Regarding Tree in DOTNET Pin
Antti Keskinen12-Sep-04 10:12
Antti Keskinen12-Sep-04 10:12 
GeneralDouble buffering in MFC Pin
amigaguy12-Sep-04 6:07
amigaguy12-Sep-04 6:07 
GeneralRe: Double buffering in MFC Pin
Antti Keskinen12-Sep-04 10:33
Antti Keskinen12-Sep-04 10:33 
What is the project type you created ? A MDI application ? An SDI application ? A dialog project ? The OnDraw method is only there if you are handling a class based on CView. CView::OnDraw is a virtual function that you can override in order to define custom behaviour.

The concept of overriding is related to the object-oriented programming model. Consider that you have a class, call it class Alpha, for now. Class Alpha has a member function called Func1 that is declared as virtual. If you derive a class called Class Beta from Alpha, and write a function called Func1 in there, this new function will override the old Func1 from Alpha.

In the MFC world, the class thinking is at large. What OnDraw does is answer to WM_PAINT windows message.

The Visual Studio .NET doesn't boast ClassWizard anymore. It is replaced by a more functioning event list in the Properties of the class. I assume you know how to use the Class View, which shows all the classes your project contain. In this view, right-click on the class name you wish to write a message handler to, then select 'Properties'. In the properties view, look for a row of buttons in the top section. From these, find one which gives a tooltip 'Messages' or 'Events'. Click on it. A list of Windows messages you can react to is displayed. Find 'WM_PAINT', and write 'OnPaint' into the box next to it and press enter.

Now write the code to first create a CMemDC, and draw your stuff there. Then destroy the CMemDC or let it go out of scope, and it will blit the new graphic into the target device context.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Double buffering in MFC Pin
Anonymous12-Sep-04 11:50
Anonymous12-Sep-04 11:50 
GeneralCDaoDatabase connection string in Windows XP Pin
olis12-Sep-04 5:36
olis12-Sep-04 5:36 
GeneralProcess help Pin
swarup12-Sep-04 4:40
swarup12-Sep-04 4:40 
GeneralToolbar in views Pin
Jens Christiansen12-Sep-04 3:26
Jens Christiansen12-Sep-04 3:26 
QuestionHow can I export my class in "Regular DLL that statically linked MFC"? Pin
Behzad Ebrahimi12-Sep-04 3:20
Behzad Ebrahimi12-Sep-04 3:20 
GeneralDialog in taskbar steals focus from children Pin
PEK12-Sep-04 1:49
PEK12-Sep-04 1:49 
GeneralRe: Dialog in taskbar steals focus from children Pin
Gary R. Wheeler12-Sep-04 2:44
Gary R. Wheeler12-Sep-04 2:44 
GeneralRe: Dialog in taskbar steals focus from children Pin
PEK12-Sep-04 4:55
PEK12-Sep-04 4:55 
Generalbackground color Pin
Joerg Warthemann12-Sep-04 1:42
Joerg Warthemann12-Sep-04 1:42 
GeneralGetting the -REAL- printable area of a page Pin
Ernesto D.11-Sep-04 21:48
Ernesto D.11-Sep-04 21:48 
GeneralRe: Getting the -REAL- printable area of a page Pin
Blake Miller13-Sep-04 6:10
Blake Miller13-Sep-04 6:10 
Questionhow to find which port is active? Pin
anuchelvi11-Sep-04 20:55
anuchelvi11-Sep-04 20:55 
AnswerRe: how to find which port is active? Pin
Mad__13-Sep-04 4:49
Mad__13-Sep-04 4:49 
Generalsearching for Nicholl-Lee- Nicholl C or C++ code Pin
gledaoc11-Sep-04 18:26
gledaoc11-Sep-04 18:26 
GeneralRe: searching for Nicholl-Lee- Nicholl C or C++ code Pin
Ravi Bhavnani12-Sep-04 7:16
professionalRavi Bhavnani12-Sep-04 7:16 
Generaldeselecting list ctrl items Pin
Tyrus18211-Sep-04 14:05
Tyrus18211-Sep-04 14:05 
GeneralRe: deselecting list ctrl items Pin
Branislav11-Sep-04 22:32
Branislav11-Sep-04 22:32 

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.