Hi
Well basically I've got a small opengl demo from nehe to render to a .NET control. I've got rid of this:
if (!(hWnd=CreateWindowEx(dwExStyle,"OpenGL",title,dwStyle |WS_CLIPSIBLINGS |WS_CLIPCHILDREN,0, 0, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top,NULL,NULL,hInstance,NULL)))
and replaced it with this:
hWnd = (HWND)hwnd_of_control
and with a couple of other mods it all works fine except that no messages get to the programme. I'm pretty new to c++, so whats going wrong?
if (!CreateGLWindow("NeHe's Textures, Lighting & Keyboard Tutorial",640,480,16,fullscreen))
{
return 0; // Quit If Window Was Not Created
}
while(!done) // Loop That Runs While done=FALSE
{
MessageBox(NULL,"this message box never shows.","ERROR",MB_OK | MB_ICONINFORMATION);
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) // Is There A Message Waiting?
{
if (msg.message==WM_QUIT) // Have We Received A Quit Message?
{
done=TRUE; // If So done=TRUE
}
else // If Not, Deal With Window Messages
{
TranslateMessage(&msg); // Translate The Message
DispatchMessage(&msg); // Dispatch The Message
}
}
else // If There Are No Messages
{
// Draw The Scene. Watch For ESC Key And Quit Messages From DrawGLScene()
if ((active && !DrawGLScene()) || keys[VK_ESCAPE]) // Active? Was There A Quit Received?
{
done=TRUE; // ESC or DrawGLScene Signalled A Quit
}
else
{
...
}
If anyones interested here it is: http://matix.co.uk/OpenGL.zip
Thanks a lot