First to clarify, even in .Net Windows Forms everything runs in a while
loop. When you say Application::Run(...), it actually starts a while
loop, waiting for messages on the process main thread which can be
handled by adding a message filter :-
Application::AddMessageFilter(...)
which must be done before Application::Run(...) as this 'Run' method
starts an infinite while loop.
Now, this part was common between your directx application and the
windows forms application. Now you have another thing, there is another
filter working in background, all the windows message is forwarded to
the form's onWindowProc method, which can be overridden.
Even the timer's WM_TIMER event goes thru all this :)
Remember, Timer you can not rely upon ... as if you have other window
message handler running for a longer time, timer event will not come on
time.
Tell us what you need to do exactly and I hope we can help you with that...
--
Abhijeet Dev
Neal wrote:
managed C++
VS 2003
I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get confused. When I was using
Directx everything was being run from a while loop, so that was no problem
for me in seeing where to place conditional statements and other functions.
With windows forms do I need to have an event and eventhandler? it just
confuses me because of the form.h and form.cpp and pretty much all there is
in the .cpp is Application::Run(....).
Also can you give me advice on any good books for C++ .Net and WIndows. I
have Mircosoft Visual C++ .NET (step by step) by Templeman and Olsen but they
really don't give that much info on Windows forms and such.