Your first standalone snippet works fine here. Have you tried it with a clean PureBasic install? Which OS are you using, etc?
It's definitely not a bug though, as I've been using MessageBox like that in my apps for many previous versions of PureBasic.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
The Common Controls library must be initialized, just starting with a bare api command like that is hit-or-miss at best. The call to MessageRequester is telling PB you're doing something requiring an InitComonControlsEx_() and so it's allowing it to work. Not a bug in PureBasic.
netmaestro wrote:The Common Controls library must be initialized, just starting with a bare api command like that is hit-or-miss at best. The call to MessageRequester is telling PB you're doing something requiring an InitComonControlsEx_() and so it's allowing it to work. Not a bug in PureBasic.
Why?
The common messagebox() does not require common controls.
netmaestro wrote:The Common Controls library must be initialized, just starting with a bare api command like that is hit-or-miss at best. The call to MessageRequester is telling PB you're doing something requiring an InitComonControlsEx_() and so it's allowing it to work. Not a bug in PureBasic.
Why?
The common messagebox() does not require common controls.
It seems to be necessary if you compile with manifest and run the exe on a windows with themes enabled...
Maybe because themes use COMCTL32.DLL ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
netmaestro wrote:The Common Controls library must be initialized, just starting with a bare api command like that is hit-or-miss at best. The call to MessageRequester is telling PB you're doing something requiring an InitComonControlsEx_() and so it's allowing it to work. Not a bug in PureBasic.
Why?
The common messagebox() does not require common controls.
Themed controls require the common controls lib to be loaded.
When the app is themed the msbox button may no get loaded for example (and Windows exits this functionality?).
I ever had this issue with the lcc compiler having a manifest, after some testing i discovered the initc.. need's to be invoked.
This may be your issue as well, iow it may not be a msgbox issue but an incorrect theming handling in PureBasic?
But that i don't know.
It's only an issue if things are (not) handled like i explained.
If you add a manifest it is required to load the common controls, maybe nnot initialise it but at least load.
That is what i discovered about theming and if i am wrong let me know.., and yes i expect a compiler following the rules.
Anyway this still may be another issue.
>Why should this be a PB issue? It only happens when the PB function is _not_ used.
That be so if you don't think outside the box.
You can go two routes here:
- decide you want PB to handle things for you and use the PB function MessageRequester() (then InitCommonControls() is called for you)
- decide you want to do things yourself and call the MessageBox() API (then you have to call InitCommonControls() yourself).
You cannot decide you want to do stuff yourself and then complain that PB isn't doing things for you. If you want to use API,
you also have to make sure everything is initialized the way you need it. This isn't PB's job.
Note that i still assume this is related to theming..
No, in this case you are wrong imo.
Once the theming manifest is set by the compiler (via its settings) it should implement theming correctly and not half-way.
By adding the manifest you give the assumtion that everything is ok while it's not.
Anyway, odd that the internal function does something extra...? (sounds like jim'll fix-it mode)
Hope to hear about this soon as well.
Besides what other api may fail?