我使用CSpinButtonCtrl来修改好友CEdit的整数值。它的优点是,当值超过1.000时,CSpinButtonCtrl会在数字中放置数千个分隔周期。问题是,MFC的直接数据交换只读取数千分隔符之前的数字,以便CEdit中的1.000在交换值的int中变为1。
现在,我只是在检查CEdit中的数千个分隔符、句点和逗号,每次都会发生变化,然后可能会像这样删除它:
//get current line from CEdit
CString line;
CEdit* pEdit = (CEdit*)GetDlgItem(nId);
pEdit->GetWind
这在主"example dlg.cpp“文件中:
void CHelixV3Dlg::OnBnClickedCancel()
{
CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1);
//works fine, defined as: *CWnd GetDlgItem(int nID); in this file
}
这是test.cpp源文件
void test()
{
CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1);
//does not work at all, see
我为CEdit创建了一个控件变量:
class CGateDlg : public CDialog
{
...
public:
// here is my control's variable
CEdit m_edit_a;
// here I map variable to control
virtual void DoDataExchange(CDataExchange* pDX);
}
下面是我将变量映射到控件的方式:
void CGateDlg::DoDataExchange(CDataExchan
我是ATL的新人。所以请原谅我问这个问题。
问题描述:将一个CEdit控件添加到ATL对话框类中。它附加在对话框初始化函数中。
//Define the edit control
ATLControls::CEdit m_txtInput;
//In the OnInitDialog function
m_txtInput.Attach(GetDlgItem(IDC_INPUT_LINE));
m_txtInput.SetWindowText(_T("New directory"));
//In the public memeber function of the di