注册 登录
编程论坛 VC++/MFC

[求助]也许很简单,但我真的不会啊!关于DDX...

cheqiancao 发布于 2006-11-16 16:35, 897 次点击
vc++.net ,用DDX_Text可以实现CString类型与控件之间的动态数据交换.
请问,要用什么宏实现int类型与控件之间的动态数据交换呢????
急啊!
3 回复
#2
smartwind2006-11-17 16:14
// simple text operations
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, LONGLONG& value);
void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, ULONGLONG& value);
void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, CString& value);
void AFXAPI DDX_Text(__in CDataExchange* pDX, __in int nIDC, __out_ecount_z(nMaxLen) LPTSTR value, __in int nMaxLen);
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);
void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, GUID& value);
void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, DECIMAL& value);
void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, FILETIME& value);

以上是DDX_Text的定义,只要上面有的类型的都可以
#3
EDISONZHU1112011-06-11 19:39
谁能帮助我编一个上午10:00记录换手率和DDX数值的公式?我是大智慧L2用户,QQ:531632450相控阵,不胜感谢
#4
duliningmiss2011-06-14 15:44
DDX_Text(pDX, IDC_EDIT8, m_data);   向导添加变量时,在组合框 类别(T):选择Value;左边选择int 变量类型,变量名下输入变量名就好了,如我输入的变量名是m_data。
1