How do I compile a DX program with an MFC program
How do I compile a DX program with an MFC program and have the DXprogram have access to the MFC program
I made an MFC program and a DX template program and I don''t really want the programs to be incorperated but to plug in together and the DX program to get data from the MFC program
I tried to do this
void CMyD3DApplication::StartDXApp()//change void later
{
//-----------------------------------------------------------------------------
// Name: WinMain()
// Desc: Entry point to the program. Initializes everything, and goes into a
// message-processing loop. Idle time is used to render the scene.
//-----------------------------------------------------------------------------
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
CMyD3DApplication d3dApp;
g_pApp = &d3dApp
g_hInst = hInst;
if( FAILED( d3dApp.Create( hInst ) ) )
return 0;
return d3dApp.Run();
}
}
and I get
C:\CURPRO\WORKING\combine\VISIONdata\DXRay\DXRay.cpp(95) : error C2601: ''WinMain'' : local function definitions are illegal
I understand what the error is but I want the CMyD3DApplication class to be incorperated into the MFC program
I am opened to any suggestions,please!
Well, incorporating your DX program with your MFC program doesn''t take place on the syntax level
You shouldn''t be incorporating an actual DX program with your MFC app, just the API. Creating a wrapper for DX is a good start, but it shouldn''t be an application within itself - MFC will handle the "application"ness of it. Your wrapper class should contain methods for initialization, shutdown, rendering callbacks, etc., but it shouldn''t act like an independent application in any way. It should only handle intrinsic DX things.
You shouldn''t be incorporating an actual DX program with your MFC app, just the API. Creating a wrapper for DX is a good start, but it shouldn''t be an application within itself - MFC will handle the "application"ness of it. Your wrapper class should contain methods for initialization, shutdown, rendering callbacks, etc., but it shouldn''t act like an independent application in any way. It should only handle intrinsic DX things.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement