Application crash due to skin framework |
Post Reply |
Author | |
varvaripavel
Newbie Joined: 14 December 2009 Location: Romania Status: Offline Points: 9 |
Post Options
Thanks(0)
Posted: 26 September 2010 at 10:46am |
Hi,
I have an application which uses the skin framework: XTPSkinManager()->SetApplyOptions( ... ); XTPSkinManager()->LoadSkin( ... ); Nothing special and everything works nice util I need to print something. Then, the application carshes (more exactley, the crash is in a thread related to the driver); somehow, the printer driver interfes with the skin manager. The cause it's pretty obvious because the crash doesn't appear when the skin manager it's not activated. I tried to disable the skins for the printing module - but the crashes appear again. XTPSkinManager()->SetAutoApplyNewWindows( FALSE ); XTPSkinManager()->SetAutoApplyNewThreads( FALSE ); or even: XTPSkinManager()->RemoveAll(); The problem it's pretty bad since, at this point I have to decide wheather I keep the skin or the crashes. Do you have any idea how I could fix (or avoid) this ? Pavel Varvari XISOFT SRL |
|
varvaripavel
Newbie Joined: 14 December 2009 Location: Romania Status: Offline Points: 9 |
Post Options
Thanks(0)
|
I figure out to make a fix (not the best) for the problem:
void CXTPSkinManagerApiHook::InitializeHookManagement() { ......... if (XTPSkinManager()->GetAutoApplyNewThreads() == TRUE ) { ADDHOOK("KERNEL32.DLL", LoadLibraryA); ADDHOOK("KERNEL32.DLL", LoadLibraryW); ADDHOOK("KERNEL32.DLL", LoadLibraryExA); ADDHOOK("KERNEL32.DLL", LoadLibraryExW); ADDHOOK("KERNEL32.DLL", GetProcAddress); ADDHOOK("KERNEL32.DLL", GetModuleHandleA); ADDHOOK("KERNEL32.DLL", CreateThread); } .................. } So, the problem is due to one (or more from the hooks above) You can reproduce it on Windows Vista or XP with the official drivers from HP LaserJet 1320 printers (I guess other HP drivers, too). Just try to repeat a few times the print preview / configure options in a default application with skins. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Probably, your exe loads a dll/ocx that is not compatible with the skinning hook. Look in your "Output window" and see if a suspicious DLL (presumably with GUI) is loaded when printing. Then do the following:
XTPSkinManager()->ExcludeModule("BadLib.dll");
|
|
PokerMemento - http://www.pokermemento.com/
|
|
varvaripavel
Newbie Joined: 14 December 2009 Location: Romania Status: Offline Points: 9 |
Post Options
Thanks(0)
|
That would be an idea but, you cannot know the "BadLib.dll"; I mean, I could exclude a certain DLL (like "HP_Driver.dll") but there could always be a new one (like "Canon_Driver.dll")
I posted a better solution but the comment was not approved yet :P |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |