Archived

This topic is now archived and is closed to further replies.

Dr_Fripp

Problem with creating a window

Recommended Posts

I'm making a game for school, which needs some basic window setup. Normally, I use Nehe's windows creating procedures for this and it works. But right now things are a bit different, because we have to use DirectPlay and delphi. First, my program creates a form which is going to be used for our DirectPlay lobby. This works fine, the netcode works too and the lobby does what it's supposed to do. Now, when I press a button "Start new game", I try to create a window and initialize opengl, the way it's done in Nehe's tutorial. But it already goes wrong before the OpenGL initialization. When I call the function H_wnd := CreateWindowEx( dwExStyle, 'OpenGl', Title, dwStyle, 0, 0, windowRect.right-windowrect.left,windowrect.bottom-windowRect.top, 0, 0, h_Instance, nil); it doesn't want to return a valid hWnd to me (result is always 0). It might be because we don't destroy the "lobby form" before we try to create our window...but it can't be destroyed because the DirectPlay facilities will be destroyed along with it. So I need CreateWindow to work (it goes trough my WndProc() twice but with 0 as the messages), but I have no clue what's wrong. It definately works when I try the code seperately, without creating a lobby. Please help, it will be much appreciated! P.S. I can imagine one might need more info, but I can in no way post the whole program here of course, and I'm not sure what to look for besides the CreateWindow procedure. If there's something specific that you need to know, please ask. [edited by - Dr_Fripp on May 7, 2003 6:44:44 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Dr_Fripp
Guys, don''t worry, I have the solution and it all works, thanks anyway!


Please post the solution so that others may benefit from your experience.

Thanks!

Share this post


Link to post
Share on other sites