Print Page | Close Window

XTP12.1.1 skin problem of VB6 COM class

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=13275
Printed Date: 16 May 2024 at 7:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTP12.1.1 skin problem of VB6 COM class
Posted By: mihey
Subject: XTP12.1.1 skin problem of VB6 COM class
Date Posted: 28 January 2009 at 6:33am

Hi,

After migrating our project from XTP 11.2.2 to XTP12.1.1 I have a nasty problem with skinning our plug-ins which are created as COM objects in VB6. I tested it only on my XP SP3. After opening a dialog the window frame is drawn un-skinned with the dark text and then disappears completely after a few seconds (see screenshots).  

 
 
With the old library this worked perfectly. For reproduced this problem I've created a small test application based on "SkinControls" example application. In SkinControlsDlg.cpp module I’ve added OnBnClickedButtonSample handler which invokes the COM object when you press "Sample Button". The changed .cpp file is included into the attachment as well as the VB project of the COM object. The file XTPSkinTest.dll contains the compiled COM class and has to be registered first.
 
Here is the test
https://forum.codejock.com/uploads/20090128_063021_XTPSkinTest.zip - uploads/20090128_063021_XTPSkinTest.zip
 
Any ideas?
Best regards, Mikhail Tyukin



Replies:
Posted By: Oleg
Date Posted: 28 January 2009 at 7:27am
Hi,
 
Please change code as
 
 if (SUCCEEDED(hr))
  {
   CXTPSkinManagerApiHook::GetInstance()->FinalizeHookManagement();
   CXTPSkinManagerApiHook::GetInstance()->InitializeHookManagement();
 
   pDispatch->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispid);
   hr = pDispatch->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &params,  &result,   NULL,   NULL);
  }
 
It will hook new loaded dlls.
 
 
to skin Visual Basic controls you can add
 
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderRT6CheckBox"), _T("Button"));
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderCheckBox"), _T("Button"));
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderRT6OptionButton"), _T("Button"));
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderRT6CommandButton"), _T("Button"));
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderOptionButton"), _T("Button"));
 XTPSkinManager()->GetClassMap()->AddSynonymClass(_T("ThunderCommandButton"), _T("Button"));
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mihey
Date Posted: 28 January 2009 at 9:55am

Hi Oleg!

It works now. Great!

I just add these two lines after initializing all my plugins and now it works like a charm.

Concerning AddSynonymClass, I used already this method before with my VB controls, anyway thank you for the info.

BTW, if I do AddSynonymClass(_T("StatusBar20WndClass"), _T("msctls_statusbar32") it doesn’t work. I guess because using own drawing methods.

Thanks a lot for your fast support!
Kind Regards,
Mikhail Tyukin

Development leader

nicetec GmbH




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net