Page 2 of 2
Re: MessageBox failed
Posted: Mon Jul 05, 2010 7:35 pm
by ts-soft
Edwin Knoppert wrote: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?
The manifest file can be also added as an extra file, wants the compiler should guess this?
Imho, if you use API, do it complete!
Re: MessageBox failed
Posted: Mon Jul 05, 2010 7:38 pm
by Edwin Knoppert
No then the user has to fix it himself.
There may be more things relying on the presence of this library when the manifest is added.
You simply assume the only thing failing is the messagebox api, the user cannot know that unless he investigates this (for hours?).
PureBasic says you can use the Windows api, well, here we are..
(Still under assumption of theming failure)
Re: MessageBox failed
Posted: Mon Jul 05, 2010 7:51 pm
by freak
If you want to use common controls, initialize them. What is so hard to understand there?
The fact that this worked with commctl5 (no manifest) without initialization is just pure luck if you ask me.
> PureBasic says you can use the Windows api, well, here we are..
Just call InitCommonControls[Ex]() like the API docs say you have to and you are fine. What is the big deal?
If you want to use API, you have to read the API docs and not hope for magical fixes from the PB compiler.
Re: MessageBox failed
Posted: Mon Jul 05, 2010 8:23 pm
by Edwin Knoppert
>If you want to use common controls, initialize them. What is so hard to understand there?
There is no direct question for a common control.
Only insiders know that the manifest leads to *standard* controls being handled via the common controls lib when theming is applied.
Did you?
>Just call InitCommonControls[Ex]() like the API docs say you have to and you are fine.
And where is that?
Like i said, if theming is set by a compilersetting and not manually it should handle this part all the way, not half way.
Why are you protecting a design flaw (IF THIS IS ACTUALLY THE CAUSE)
Re: MessageBox failed
Posted: Sat Jul 10, 2010 6:24 am
by Suirad
Edwin Knoppert wrote:
Like i said, if theming is set by a compilersetting and not manually it should handle this part all the way, not half way.
well i for one would assume that a compiler setting would affect code thats handled completely by the compiler.
as freak said before, if you want to do things your way that means your dealing with the windows api. that means your willing to do things exactly as the api states.
Re: MessageBox failed
Posted: Sat Jul 10, 2010 10:59 am
by Fred
Edwin: why Microsoft doesn't call automatically InitCommonControlsEx() when they DLL loads then ? This is a separate call which is mandatory before using common control, the API doc is very clear about it, so if you don't add it and your code doesn't work, it's no way a PB issue. You can add the manifest with different way, it's not the compiler job to detect and add this call automagically.
Re: MessageBox failed
Posted: Sat Jul 10, 2010 11:41 am
by Edwin Knoppert
That's a good question which i don't know the answer for.
But several of the responses are incorrect imo.
*If* i choose to add the manifest manually i should be as 'api programmer' be aware of possible issues regarding theming.
Iow blaming the programmer is fine then.
(It took me several days to figure out the relationship between the two though)
But if you add a functionality via your IDE it's run-and-go situation for nearly all your users.
They don't expect the relationship between the manifest and loading some library.
The manifest is a black box situation for them.
For those it has nothing to do with a messagebox api or any other api (guess why they come over here asking for a solution?).
I stick with this idea.
Regarding the messagebox..., is it to your knowledge actually a theming issue?
Just wondering..
This matter i have tested XP/SP3 and W7 and both worked fine but i have seen this before, there is something unpredictable about this.
In the PureBasic exe the commctrls are loaded but not via the exe directly but via some MS dll (and rather late).
This may have been something to your rescue for many users.
Re: MessageBox failed
Posted: Sat Jul 10, 2010 3:06 pm
by freak
Edwin Knoppert wrote:But if you add a functionality via your IDE it's run-and-go situation for nearly all your users.
Nearly all of our users use MessageRequester() instead of MessageBox_() and don't have any problem with it.
Edwin Knoppert wrote:Regarding the messagebox..., is it to your knowledge actually a theming issue?
Its a dll dependency issue. commctl v5 (no theming) seems to be loaded implicitly by user32, but commctl v6 (theming) is not. This is why when you call MessageBox_() (in user32) the required classes for its GUI are not registered. If you want to blame anyone, you should blame MS for messing this up without even documenting it. Anyway, using a single function from commctl, like InitCommonControls_() solves all the problems.
Edwin Knoppert wrote:In the PureBasic exe the commctrls are loaded but not via the exe directly but via some MS dll (and rather late).
This may have been something to your rescue for many users.
It is loaded when a PB command needs it. If you don't use PB GUI commands, there is no need to load it. Why should the PB compiler load a dll into an executable when it has no use for it ? Just because somebody else might need it but might forget to do so is not a good reason for that.
Anyway, PB is not the only language where this comes up, so you can hardly call it a PB issue.
Re: MessageBox failed
Posted: Sat Jul 10, 2010 6:16 pm
by Suirad
lol its like getting mad that you have to call initnetwork() before having to use any of the networking commands. it should be called for you

Re: MessageBox failed
Posted: Sat Jul 10, 2010 6:44 pm
by Edwin Knoppert
I give up, you people are twisting this with other behaviour.
I've been clear enough.