Jump to content
  • Advertisement
Sign in to follow this  

Main loop in Winforms applications?

This topic is 4530 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to call an update function on one of my objects repeatedly. How can I do this in a winforms application? VC++ 2005 Express created the following main function for me:
int main(array<System::String ^> ^args)
	// Enabling Windows XP visual effects before any controls are created

	System::Windows::Forms::ApplicationContext ac;
	ac.MainForm = gcnew Form1();
	// Create the main window and run it
	return 0;
Basically, I want to get inside of whatever function Application::Run is calling so that I can do my own thing in between message polls. Thanks for any help~ Riley

Share this post

Link to post
Share on other sites
I just got around the problem with what feels like a hack: I added a timer control to fire every 100 ms that will call my update function. I don't need many updates, but if I did, this solution would not suffice.

I'd still like to know how to get into that main loop... there must be a way!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!