Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do I use the keyword refof C# in C++? Pin
Hamid_RT16-May-08 19:27
Hamid_RT16-May-08 19:27 
QuestionHow do I send a WM_PAINT message Pin
Kwanalouie16-May-08 12:28
Kwanalouie16-May-08 12:28 
AnswerRe: How do I send a WM_PAINT message Pin
Nelek16-May-08 15:16
protectorNelek16-May-08 15:16 
GeneralRe: How do I send a WM_PAINT message Pin
Kwanalouie16-May-08 16:23
Kwanalouie16-May-08 16:23 
QuestionRe: How do I send a WM_PAINT message Pin
Nelek16-May-08 23:59
protectorNelek16-May-08 23:59 
AnswerRe: How do I send a WM_PAINT message Pin
akira3217-May-08 2:22
akira3217-May-08 2:22 
AnswerRe: How do I send a WM_PAINT message Pin
Kwanalouie17-May-08 3:45
Kwanalouie17-May-08 3:45 
GeneralRe: How do I send a WM_PAINT message Pin
Nelek17-May-08 8:16
protectorNelek17-May-08 8:16 
I think you are missunderstanding how it works. The MainFrm actually is not the best place to draw things on the "screen", this is better to be done in the CView-derived class. In Grosso Modo the main frame is the class that controls the blue title bar and the menu, not the white surface where the things come

As you are using MFC and Doc-View architechture with SDI application I would make it in other way. You should have a class called CTestProgramView as well. There is the place to handle the things that you are seeing in your application. There is where you should have to code your OnDraw code and the update can be managed with CDocument::UpdateAllViews (NULL), that will call the OnDraw on all views from the document, but as you are in a SDI programm only one view will be drawn. Or, another possibility, inside the CTestProgrammView itself, then you can use Invalidate () and UpdateWindow () as I told you in my first answer, that will "erase" the contents of the view and force it to redraw calling the OnDraw ().

BTW, if you want to make it with your structure, then you can make more or less like that:

extern CTestProgramApp theApp;
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
pFrame->OnViewShowTest ();


But as I told you... I would use the Doc-View performance, it will make things easier for you.

Greetings.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

GeneralRe: How do I send a WM_PAINT message Pin
Kwanalouie18-May-08 1:35
Kwanalouie18-May-08 1:35 
GeneralRe: How do I send a WM_PAINT message Pin
Nelek21-May-08 8:23
protectorNelek21-May-08 8:23 
QuestionSOLVED - Passing CObject to OnUpdate - compiler error C2039 [modified] Pin
Vaclav_16-May-08 6:12
Vaclav_16-May-08 6:12 
AnswerRe: Passing CObject to OnUpdate - compiler error C2039 Pin
mid=574116-May-08 6:49
mid=574116-May-08 6:49 
GeneralRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Kelly Herald16-May-08 6:52
Kelly Herald16-May-08 6:52 
AnswerRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Kelly Herald16-May-08 6:50
Kelly Herald16-May-08 6:50 
GeneralRe: Passing CObject to OnUpdate - compiler error C2039 Pin
Vaclav_16-May-08 7:01
Vaclav_16-May-08 7:01 
QuestionDo any body know the encoding formate of .rc file in VS 2005? Pin
sumit.durg16-May-08 5:19
sumit.durg16-May-08 5:19 
AnswerRe: Do any body know the encoding formate of .rc file in VS 2005? Pin
mid=574116-May-08 6:46
mid=574116-May-08 6:46 
QuestionError adding a string to a DropList Pin
piul16-May-08 5:13
piul16-May-08 5:13 
AnswerRe: Error adding a string to a DropList Pin
toxcct16-May-08 5:19
toxcct16-May-08 5:19 
GeneralRe: Error adding a string to a DropList Pin
piul16-May-08 5:25
piul16-May-08 5:25 
QuestionRe: Error adding a string to a DropList Pin
CPallini16-May-08 5:24
mveCPallini16-May-08 5:24 
AnswerRe: Error adding a string to a DropList Pin
piul16-May-08 5:26
piul16-May-08 5:26 
GeneralRe: Error adding a string to a DropList Pin
CPallini16-May-08 5:29
mveCPallini16-May-08 5:29 
QuestionRe: Error adding a string to a DropList Pin
piul16-May-08 5:40
piul16-May-08 5:40 
AnswerRe: Error adding a string to a DropList Pin
CPallini16-May-08 5:49
mveCPallini16-May-08 5:49 

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.