Window creation problems...

Started by
5 comments, last by Matthew Allen 24 years, 6 months ago
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?
-Kentamanos
Advertisement
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

Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
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?
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

-Kentamanos
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!
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/

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

This topic is closed to new replies.

Advertisement