View Full Version : Convert console to MFC

duck bong
04-27-2006, 10:25 PM
Hi! I have a simple VC++ 6.0 console application with an opengl setting and Cg vertex and fragment shaer.

This time I would like to create a MFC application that uses an opengl and cg vertex shader and fragment shader. But I don't know how to start. Is there any good examples to follow.

Thanks in advance!

04-28-2006, 02:05 AM
There is not much to learn, you create an MFC application with the wizard and use the different event handlers the same was as you do in a non MFC app, OnCreate, OnSize, OnPaint and so on.

The HDC and HWND variables are just hidden inside the CPaintDC and CWnd classes.

If you know how to use the ordinary GDI functions you should not havce any problems.


04-29-2006, 06:11 AM
MFC should only be used for creating tools applications like this:


You can also use it for simple windows, but the additional overhead of MFC libraries buys you nothing in that case.

If you just need an ordinary window, then Win32 API is the way to go. You can find examples on NeHe tutorial site:


duck bong
04-30-2006, 06:42 PM
Really thanks!