SetWindowTheme_() - XP

Everything else that doesn't fall into one of the other PB categories.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

SetWindowTheme_() - XP

Post by srod »

This is a strange one.

I have a complex dll (created with PB) which runs fine on Vista.

On XP, however (tested on 3 separate machines running XP), everything is fine when using the dll unless my client application makes a call to SetWindowTheme_(). With this I get an 'Application failed to Initialize..." error from Windows (almost as if system memory is being written to). If I use the same dll in source code form (as opposed to linking with the binary) then there are no problems.

Any idea what might be causing this? Could it be a base address issue for example? Any idea how I might rectify this?

Thanks.

**EDIT : if I use OpenLibrary() on "uxTheme.dll" and use CallFunctionFast to invoke SetWindowTheme_() then everything runs fine. Still, wouldn't mind knowing what is afoot here?
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SetWindowTheme_() - XP

Post by netmaestro »

Just a couple clarifications, is your dll calling SetWindowTheme? Or is it the calling appllication. If the calling application, did you write it? So basically, is it you that's making the call to SetWindowTheme or is it something you have no control over. If you, I assume you're using Import?
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: SetWindowTheme_() - XP

Post by srod »

The dll does not call SetWindowTheme_(), a client application of mine does. I do not specifically import SetWindowTheme_(), I just rely on the PB compiler doing so. I did try importing directly from UxTheme.lib and get the same problems. Only OpenLibrary seems to work okay.

The client app runs fine if I use the DLL in source code form or do not call SetWindowTheme_(). As soon as I switch to using the DLL then the problem arises. I have tested with several little programs. All run fine with the DLL until the client calls SetWindowTheme_() etc.

Sorry, if my reply does not read very well but I am without my own internet connection now and am rushed.
I may look like a mule, but I'm not a complete ass.
Denis
Enthusiast
Enthusiast
Posts: 790
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: SetWindowTheme_() - XP

Post by Denis »

I erased my answer,
i was thinking about GDI+ :oops:
A+
Denis
Post Reply