Jump to content
  • Advertisement


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


Problem with creating a window

This topic is 5613 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!