DoEvents vs. OnPaint-Invalidate()

I was just wondering if the OnPaint-Invalidate() method of creating a render loop is really better than the DoEvents method. I do not come from a directx background but I am forcing myself to do it so that I can help create the next great game (of course!)

Anyway, I just saw this method in the Coding4fun articles and it seems to definitely be a more OOP approach in any case. Are there any other benefits?

[410 byte] By [DWood] at [2008-1-28]
# 1
DoEvents allocates memory which, when running in a tight loop, doesn't get freed. So performance is fairly poor. The OnPaint-Invalidate always seemed like an ugly hack to me.

The latest and greatest loop can be read about here:
http://blogs.msdn.com/tmiller/archive/2005/05/05/415008.aspx

It requires a PInvoke, but otherwise seems like a fairly clean and performant solution.

KenPaulson at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 2
A great game loop can be found inside the DirectX Sample Framework. Look for the MainLoop() function in the /common files (of the DX folder). I can't remember the exact name of the file, but it's something like dxutil ... Good luck! Big Smile
Hardone at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...