I''m learning mfc programming and I''m wondering how does directx and mfc work together? Would you typically create a window manually as in deriving a class from CWnd or from CFrameWnd or would you use the document/view architecture? I imagine I will get a reply saying you can use all three or maybe something I dont even know about, but if so which one would generally be used? I''m just curious how they work together.
Unless you are making a tool there really isn't a justification to use MFC with DirectX, but it can be done.
You can use CWnd directly or any classes derived from it as well as a dialog based or even a full blown MFC Document/View SDI/MDI application. Really it depends on how you partition your code. It's all going to boil down to connecting to a window. How easy or hard you make it is up to you...
P.S. This is geared more towards graphics as that seems what a lot of people take on first and your mention of CWnd. This isn't to say that you can't use other parts of DirectX with an MFC application, like an audio/video editor for example, and it be completely justified but this is a game programming site so keep that in mind if my response seems narrow and simple minded.
Edited by - deadlinegrunt on July 11, 2001 4:57:42 AM
I recently posted a similar question on another programming site; one not focused on games. The response I got there was that MFC is fine for utilities and stuff like that, but for games its really slow. Since I don''t know anything about programming with DX I can''t tell you how to use them together, but the advice I''ve recieved has that you can, but you shouldn''t. Good luck.