Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Window creation problems...

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
6 replies to this topic

#1 Matthew Allen   Members   

122

Posted 08 October 1999 - 09:27 AM

Here's the scenario: I set up a window to use with a fullscreen DirectDraw game. It worked fine. Then I go and set up another monitor, complete with another video card to run it (thats two monitors, now, not just one). Now it crashes before creating a window (it doesn't do anything past the CreateWindowEx() call). I don't know if the two are related, but I really don't know what else it could be. Here is my window creation code:

// A handle to the window.
HWND hwnd;

// The windows class that describes the window.
WNDCLASS wc;

// Set up and register the window class.
wc.style = CS_DBLCLKS;
wc.lpfnWndProc = ( WNDPROC )WindowProc;
wc.cbClsExtra = NULL;
wc.cbWndExtra = NULL;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon( hInstance, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = ( HBRUSH )GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = "HEATHENwindow";

if ( RegisterClass( &wc ) == FALSE )
return FALSE;

// Create a fullscreen window.
if ( ( hwnd = CreateWindowEx( WS_EX_TOPMOST, "HEATHENwindow", "HEAHTEN",
WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0,
SCREEN_W, SCREEN_H, NULL, NULL, hInstance, NULL ) )
== NULL )
return FALSE;

I would appreciate any help anyone might have. My mind is boggled.

Matthew Allen
- mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/


#2 Kentamanos   Members   

122

Posted 08 October 1999 - 05:04 AM

When you say it doesn't do anything after the CreateWindowEx, do you mean it's actually crashing on CreateWindowEx? Or is it crashing on another line? If another line, which line?

#3 mason   Members   

128

Posted 08 October 1999 - 06:37 AM

I don't know what exactly is happening with the createwindow call, but...

Isn't there something else you have to do for multimon support? I remember seeing HMONITOR variables and EnumMonitor calls somewhere... and I believe there's a sample app that shows how to do it (multi-monitor Roids, I think).

Sorry if I'm restating the obvious.

Mason McCuskey
Spin Studios
www.spin-studios.com


#4 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 08 October 1999 - 08:26 AM

It crashes on the CreateWindowEx() call.
I put OutputDebugString() calls before and after it, and it would output the one above it but not the one below it.
Any suggestions?

#5 Kentamanos   Members   

122

Posted 08 October 1999 - 08:36 AM

It could be something in your WndProc. Right after you create a window (before the call returns), it's going to start processing messages.

I am assuming you can't use a debugger here for some reason...

------------------

-Kentamanos


#6 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 08 October 1999 - 09:18 AM

All I could figure is you need the WS_VISIBLE flag for window style also, it worked fine for me when I did it, didn't work without it!

#7 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 08 October 1999 - 09:27 AM

I feel stupid I didn't really think about the problem obviously, I think Kentamanos is right about WndProc being the probable cause.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.