Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPPropertySheet resource problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertySheet resource problem

 Post Reply Post Reply
Author
Message
andreypir View Drop Down
Newbie
Newbie
Avatar

Joined: 20 August 2015
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote andreypir Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertySheet resource problem
    Posted: 04 February 2022 at 8:21pm
I need to use CXTPPropertySheet to display property pages implemented in several modules (.dll). However, the way CXTPPropertySheet is implemented it assumes all CXTPPropertyPage objects added to it load their templates from the same module.
CXTPPropertySheet::CreateClient() calls pPage->LoadTemplate() for each page and fails 
if any of them fails. 
CXTPPropertyPage::LoadTemplate() uses a singleton XTPResourceManager() to find the dialog 
template. And so there is no way to set different resource instances for different pages.
A simple solution is to declare CXTPPropertyPage::LoadTemplate() or 
CXTPPropertyPage::LoadTemplate(HGLOBALhTemplateHINSTANCEhInst) virtual. That would
allow me to overload it in the derived class and set proper handle to XTPResourceManager().

 
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2022 at 5:24am
Hello,

I added virtual specifier for LoadTemplate functions as you asked.

Regards,
Artem Gontarenko
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.063 seconds.