Ok. Sorry for all the trouble. I have found a sollution now that makes me
able to use the dialog boxes. However. I do not understand why it works with
this “fix”
If i include commctrl.h AND call InitCommonControls ANYWHERE it works.
The weird part is that i can call InitCommonControls after the whole game
engine is shutdown.
So calling that function doesnt seem to be as important as just having it
linked into the exe.
Just out of curiosity it would be fun if anyone could explain why it starts
to work by just having it anywhere in the code without actually calling it
before creating the DialogBox.
Happy thing is that I can now continue on solving some real problems without
having to worry about having to switch away from SDL.
// Tomaz
----Original Message Follows----From: john@johnnypops.demon.co.uk (John Popplewell)
Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: "A list for developers using the SDL library. (includes
SDL-announce)"
Subject: Re: [SDL] Dialog boxes.
Date: Mon, 13 Mar 2006 22:33:01 +0000
On Mon, Mar 13, 2006 at 09:22:00PM +0100, Tomas Jakobsson wrote:
This is the code i use in the regular win32 code:
while (PeekMessage (&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&Message);
DispatchMessage (&Message);if (Message.message == WM_QUIT) pBase->Quit = TRUE;
}
and this is the code i use in the SDL code:
while (SDL_PollEvent (&Event))
{
… lots and lots of code to grab input and other stuff
}Which is run each frame.
I just did a test and ran both the SDL_PollEvents loop AND the plain
win32
PeekMessage thing right before creating my DialogBox just to be sure that
all messages are flushed out and it still wont show up.
A simple MessageBox works just fine tho.MessageBox (NULL, “Test”, “Test”, MB_OK);
// Tomaz
Tomaz,
the attached code displays an OpenGL/SDL window and a modeless dialog.
I’m using the current CVS version of SDL. Works OK here.
Please show us a small, complete example that exhibits the problem,
best regards,
John.
<< resource.h >>
<< modeless.rc >>
<< modeless.c >>
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl