Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - XTP12.1.1 skin problem of VB6 COM class
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XTP12.1.1 skin problem of VB6 COM class

 Post Reply Post Reply
Author
Message
mihey View Drop Down
Groupie
Groupie
Avatar

Joined: 14 May 2003
Location: Germany
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote mihey Quote  Post ReplyReply Direct Link To This Post Topic: XTP12.1.1 skin problem of VB6 COM class
    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
 
Any ideas?
Best regards, Mikhail Tyukin
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mihey View Drop Down
Groupie
Groupie
Avatar

Joined: 14 May 2003
Location: Germany
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote mihey Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.