Hello!
I'd like to write an application which should use DirectX, but not in the whole window, only a part of the window.
In the other parts of the window there should be buttons and input areas to controll what is happening inside the DirectX area.
So appart of the DirectX part, that looks like a normal CLR windows forms application or a MFC application.
My questions are:
Is it possible to include such a DirectX area in a windows forms application or MFC application
(Is windows forms application better for this than MFC or the other way round )
How can I include this area in a windows forms application or MFC application
Are there some sample applications/codes for that
I searched but I haven't found matching questions, sorry.
Also I'm pretty new to that, so sorry if these questions are stupid.
One or two good links is all I need as an answer. :)
Thanks!

DirectX Area inside a CLR/WFA or MFC window?
Joie Cariaga
LPXO
Performance hit doesn't matter, actually it's not for a game but for a scientific application. (In which some data should be presented in a 3-D view...)
But sorry, yet it is totally unclear to me how I can point this 3-D window to a CLR/windows forms application.
(As I said, I'm a absolute beginner in graphic programing...)
According to the tutorial, this is how I create the DirectX window:
....
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
// Register the window class
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
"window name", NULL };
RegisterClassEx( &wc );
// Create the application's window
HWND hWnd = CreateWindow( "window name", "window title",
WS_OVERLAPPEDWINDOW, 100, 100, 300, 300,
NULL, NULL, wc.hInstance, NULL );
// Initialize Direct3D
if( SUCCEEDED( InitD3D( hWnd ) ) )
{
// Create the vertex buffer
if( SUCCEEDED( InitVB() ) )
{
// Show the window
ShowWindow( hWnd, SW_SHOWDEFAULT );
UpdateWindow( hWnd );
// Enter the message loop
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( msg.message!=WM_QUIT )
{
if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
Render();
}
}
}
UnregisterClass( "window name", wc.hInstance );
return 0;
}
But in a CLR/windows forms application, I got a totally different main() function, how can I call the 3D window there
Thanks!
Vibhu Bansal
You will want the DiurectX SDK April 2006 - this is the latest of the Managed DX SDK and from what i hear they usualy make lots of improvements with every bi-monthly release.
withersd
OK, now I tried managed code.
But there is a new problem:
I can edit the windows properties in the graphic editor*, but when compiling that, it is simply ignored:
I only get the DirectX window, but not the self-designed window.
So how can I apply my design changes to the windows form application window
Thanks...
(*) I simply installed a managed Code example from the DirectX SDK and tried to edit the window.