主题:关于DDX 宏 ,请教
sunstudent
[专家分:0] 发布于 2008-05-02 10:13:00
我想知道关于DDX_Control()和DDX_Text(),之间的区别和尽量多的这方面的资料,请高手,多指点一下,详细的说明一下。不知哪里有这类函数的资料,可否提供一些,谢谢!
回复列表 (共2个回复)
沙发
f-wind [专家分:1240] 发布于 2008-05-04 13:35:00
The DDX_Control function subclasses the control, specified by nIDC, of the dialog box, form view, or control view object.
void AFXAPI DDX_Control(
CDataExchange* pDX,
int nIDC,
CWnd& rControl
);
Parameters
pDX
A pointer to a CDataExchange object.
nIDC
The resource ID of the control to be subclassed.
rControl
A reference to a member variable of the dialog box, form view, or control view object related to the specified control.
Remarks
The pDX object is supplied by the framework when the DoDataExchange function is called. Therefore, DDX_Control should only be called within your override of DoDataExchange.
For more information about DDX, see Dialog Data Exchange and Validation.
See Also
Concepts
MFC Macros and Globals
板凳
f-wind [专家分:1240] 发布于 2008-05-04 13:35:00
The DDX_Text function manages the transfer of int, UINT, long, DWORD, CString, float, or double data between an edit control in a dialog box, form view, or control view and a CString data member of the dialog box, form view, or control view object.
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
BYTE& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
short& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
int& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
UINT& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
long& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
DWORD& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
CString& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
float& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
double& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
COleCurrency& value
);
void AFXAPI DDX_Text(
CDataExchange* pDX,
int nIDC,
COleDateTime& value
);
Parameters
pDX
A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC
The ID of an edit control in the dialog box, form view, or control view object.
value
A reference to a data member in the dialog box, form view, or control view object. The data type of value depends on which of the overloaded versions of DDX_Text you use.
Remarks
For more information about DDX, see Dialog Data Exchange and Validation.
See Also
Concepts
MFC Macros and Globals
我来回复