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?
SetWindowTheme_() - XP
SetWindowTheme_() - XP
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: SetWindowTheme_() - XP
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
Re: SetWindowTheme_() - XP
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.
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.
