Page 1 of 1
CoInitialize_ & MessageRequester
Posted: Mon Feb 02, 2015 2:35 pm
by Phantomas
Hello. Some Issue with CoInitialize_ API function and MessageRequester.
In this code CoInitialize_ return 0 (zero):
Code: Select all
MessageBox_(0, "", "", 0)
Debug CoInitialize_(0)
Here CoInitialize_ return 1:
Code: Select all
MessageRequester("", "")
Debug CoInitialize_(0)
What's wrong with MessageRequester?
Re: CoInitialize_ & MessageRequester
Posted: Mon Feb 02, 2015 3:16 pm
by luis
What's wrong with MessageRequester?
I think PB calls Coinitialize() somewhere for some reason.
When displaying a requester in general it seems:
Code: Select all
InputRequester("", "", "")
Debug CoInitialize_(0)
Code: Select all
ColorRequester()
Debug CoInitialize_(0)
Code: Select all
FontRequester("Arial", 10, #PB_FontRequester_Effects)
Debug CoInitialize_(0)
etc.
This is more a side-effect than a bug IMO, like this one ->
http://www.purebasic.fr/english/viewtop ... =4&t=61239
MSDN wrote:Subsequent calls to CoInitialize or CoInitializeEx on the same thread will succeed, as long as they do not attempt to change the concurrency model, but will return S_FALSE
That's probably why you get 1 (#S_FALSE) in your second snippet.
Re: CoInitialize_ & MessageRequester
Posted: Tue Feb 10, 2015 9:04 am
by Fred
There is nothing wrong, PB commands can call any API internally for its own purpose. MessageRequester() isn't just a wrapper to MessageBox_() and handle also all program window locking.