| | |
Windows Forms - Main Message Loop
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I recently wrote a program which allows you to load in an MD2 Model and view it in various different forms (wireframe, lighting, textured etc...) This was made as a standard Windows (Win32) Porject and heavily relied on the main message loop to update (Render) the model every frame.
I now want to enhance and re-make this program to make it user friendly. I planned to do this in a form (so I can have various buttons which the user can click on to change the drawtype etc.)
Below is an example of how the main message loop was used in the original program:
As you can see I have used my "app" methods in and out of this message loop. (Update being the most prominent)
So... finally to my question! I can't seem to find anyway of seeing this main message loop for the form that I want to render my objects in. I know that the Application::Run(gcnew Form1()); method creates the form and a standard message loop but is there anyway I can see this loop code so I can put my lines of code I need here in this new forms application.
Thanks for your time.
I recently wrote a program which allows you to load in an MD2 Model and view it in various different forms (wireframe, lighting, textured etc...) This was made as a standard Windows (Win32) Porject and heavily relied on the main message loop to update (Render) the model every frame.
I now want to enhance and re-make this program to make it user friendly. I planned to do this in a form (so I can have various buttons which the user can click on to change the drawtype etc.)
Below is an example of how the main message loop was used in the original program:
C++ Syntax (Toggle Plain Text)
MyApp app(hWnd); app.Init(); // Main message loop: while (true) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { // test if this is a quit if (msg.message == WM_QUIT) break; if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } app.Update(); } app.Shutdown();
As you can see I have used my "app" methods in and out of this message loop. (Update being the most prominent)
So... finally to my question! I can't seem to find anyway of seeing this main message loop for the form that I want to render my objects in. I know that the Application::Run(gcnew Form1()); method creates the form and a standard message loop but is there anyway I can see this loop code so I can put my lines of code I need here in this new forms application.
Thanks for your time.
Last edited by ~s.o.s~; Dec 29th, 2007 at 3:40 am. Reason: Fixed code tags, learn to use them properly.
![]() |
Other Threads in the C++ Forum
- Previous Thread: help me ... :$
- Next Thread: what's wrong with this code ?
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





