Print Page | Close Window

CXTPResizeDialog missing constructors

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=23971
Printed Date: 26 November 2024 at 9:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPResizeDialog missing constructors
Posted By: lviolette
Subject: CXTPResizeDialog missing constructors
Date Posted: 30 March 2020 at 8:38pm
I have found that CXTPDialogBase is attempting to reference non-existent code in CXTPResizeDialog.

Case in point.  In CodeJock 19.1.0, you'll see the following in CXTPDialogBase:

# if (_MSC_VER > 1200)
 //<combine CXTPDialogBase::CXTPDialogBase>
 CXTPDialogBase(UINT nIDTemplate, UINT nHtmlResID = 0, CWnd* pParentWnd = NULL)
  : TBase(nIDTemplate, nHtmlResID, pParentWnd)
 {
  m_pCommandBars = 0;
 }
 //<combine CXTPDialogBase::CXTPDialogBase>
 CXTPDialogBase(LPCTSTR lpszTemplateName, LPCTSTR szHtmlResID, CWnd* pParentWnd = NULL)
  : TBase(lpszTemplateName, szHtmlResID, pParentWnd)
 {
  m_pCommandBars = 0;
 }
# endif


If you have a declaration like this:
#define CDialogSampleDlgBase CXTPDialogBase<CXTPResizeDialog>

TBase is actually CXTPResizeDialog.
CXTPResizeDialog doesn't define the constructors being called here:

You can reproduce this by modifying DialogSample.

#define CDialogSampleDlgBase CXTPDialogBase<CXTPResizeDialog>
class CDialogSampleDlg : public CDialogSampleDlgBase
{
 // Construction
public:
 CDialogSampleDlg(LPCTSTR lpszTemplateName, LPCTSTR szHtmlResID, CWnd* pParentWnd = NULL)
 : CDialogSampleDlgBase(lpszTemplateName, szHtmlResID, pParentWnd)
 {
 }


You'll get a compiler error due to CXTPResizeDialog not containing constructors that are being called from CXTPDialogBase



-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0



Replies:
Posted By: lviolette
Date Posted: 30 March 2020 at 8:43pm
For me, the workaround is to add the constructors to CXTPResizeDialog:

template<class TBase>
class CXTPDialogBase : public TBase
{
public:
...

# if (_MSC_VER > 1200)
 CXTPResizeDialog(UINT nIDTemplate, UINT nHtmlResID = 0, CWnd* pParentWnd = NULL){}
 CXTPResizeDialog(LPCTSTR lpszTemplateName, LPCTSTR szHtmlResID, CWnd* pParentWnd = NULL){}
# endif

...
};

Please advise...


-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0


Posted By: lviolette
Date Posted: 30 March 2020 at 9:29pm
This also results in declarations like this to fail to compile:
typedef CXTPDialogBase<CDialog> CDialogBase;
class CNonResizeableDlg : public CDialogBase
{
 ...
}

4>d:\proj\legacy\code\external\codejock\source\commandbars\xtpdialogbase.h(78): error C2661: 'CDialog::CDialog': no overloaded function takes 3 arguments

So are we not supposed to use CXTPDialogBase like this anymore?  The addition of those constructors in CXTPDialogBase is causing lots of problems like this, making me think we're supposed to do things differently now.



-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0


Posted By: Fredrik
Date Posted: 02 April 2020 at 1:45am
I filed this as a bug and got an answer about a week ago it has been fixed and will be available in the next release and to use my workaround (similar to yours) until then.

-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0



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