Re: [AD] problem with windows dialogs/ Win XP

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Elias Pschernig wrote:

On Sun, 2005-06-26 at 16:37 +0200, Evert Glebbeek wrote:
The comment for _win_thread_init() says that it "Initializes COM
interface for the calling thread", i.e. so that that thread may start
calling COM library functions.  I assumed it would be necessary in order
to use DirectX, but it worked for you?  Maybe someone else knows more
about it.
So... does anyone know more about this? Just browsing through some old messages that are still flagged in my inbox, so maybe this was fixed and I missed it?


I think Daniel is still working on this. I didn't find time to boot into
windows since weeks, but from what I remember, about all we know is:

- GetOpenFilename doesn't work in winXP (but does in win98) after
Allegro was initialized
- it works when _CoInitializeEx is not called, with no noticable other
adverse effects (in winXP)

MSDN naturally doesn't mention any connection between GetOpenFilename
and _CoInitializeEx.. so not really sure what is going on. As Peter
said, _ConInitializeEx seems to be required to use DX.. so we shouldn't
remove the call. Probably some obscure interaction of GetOpenFilename
with the message loop fails when _CoInitializeEx was called (and I have
no idea what this really does to a thread, e.g., what would be the
analogous call in linux?)

Here's an update of the problems:

- GetOpenFilename works correct when I changed the call of _CoInitializeEx(NULL, _COINIT_MULTITHREADED); to _CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); or to CoInitialize(NULL); in wthread.c (or when it isn't called,
see below)

- I didn't find any hints that initializing ole32 with _CoInitializeEx is neccessary for working with DirectX except Peters comment on that. But it is of course true that DirectX needs COM - so I don't know it. When I comment out the call of _win_thread_init() in wwnd.c/ wnd_thread_proc() (so _CoInitializeEx isn't called and ole32.dll is not loaded) the demo game is running fine. I looked at a basic (but old) example for using directdraw where you definitly don't need it.

- GetOpenFilename dialog and MessageBox apear behind the main window when called, with the the changes above too.

btw is there a way to compile allegro single threaded for win32?

Daniel




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/