Print Page | Close Window

Using DDX_Control for CXTPControlEdit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13597
Printed Date: 13 May 2024 at 8:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using DDX_Control for CXTPControlEdit
Posted By: DavidH
Subject: Using DDX_Control for CXTPControlEdit
Date Posted: 06 March 2009 at 5:42am
Hi,

I have defined a Dialog box in my resource file. It has an edit box defined as follows:
EDITTEXT        IDC_LENGTH,62,8,54,12,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE


In the accompanying CXTPDialog derived class I try to put an CXTPControlEdit in its place using DDX_Control:

In the class declaration:
class CSetLengthDlg: CXTPDialog {
...
CXTPControlEdit veLength_;
...
};

In the implementation:

void CSetLengthDlg::DoDataExchange(CDataExchange* pDX)
{
  CDialog::DoDataExchange(pDX);
  DDX_Control(pDX, IDC_LENGTH, veLength_);
}

The compiler complains:
error C2664: 'DDX_Control' : cannot convert parameter 3 from 'CXTPControlEdit' to 'CWnd &'

Although this is the standard MFC approach, I'm obviously taking the wrong route here.

What's the CodeJock way to do this?

Thanks a lot for your help.

David.




Replies:
Posted By: Oleg
Date Posted: 06 March 2009 at 7:12am
Hi,
CXTPControlEdit is part of CommandBars.   guess you need CXTPEdit.


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


Posted By: DavidH
Date Posted: 06 March 2009 at 7:19am
Yes, I think so too.

It's only that I'm not using CXTPControlEdit itself, but my own class derived from CXTPControlEdit.
It does some complex input parsing, so I prefer to use the same class in the Ribbon and in the Dialogs.

Maybe it's just not possible, and I just need to share the parsing logic.

David.



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