
The next ten characters are editable but can't be anything else than numbers The first six characters of the control are not editable and always show 'DESTLE' In the sample code above this control handles following: It only makes trouble.ĬMFCMaskedEdit can be used to define a special edit-mask which is then handled automatically by the control. What is the purpose of the spaces? You shouldn't work with trailing spaces but get rid of them as soon as possible. You can omit the subclassing in OnInitDialog cause that was done by DoDataExchange. After that you could replace CEdit by CMFCMaskedEdit in the dialog header and it work. Why is the m_wndMaskEdit a global variable and not a member of CDlgSchlagInfo? Simply add a member variable by using the wizard and have CEdit as class for the control. So, you must care to not dead-lock and should omit unnecessary calls. All messages send by PostMessage couldn't be processed as you currently are in a handler called from the message queue. The UpdataData itself sends and posts window messages. I don't think UpdateData should be called in a handler of a notification of a customized edit. If that is correct, I don't know why you want to call GetWindowText which hardly could retrieve a different text. In your case it should fill the new value typed in the edit field to the m_strFLEK member variable.

UpdateData(TRUE) gets data from screen to members by calling DoDataExchange. EXCEPTION: OCX Property Pages should return FALSEĬEdit *pEDit = (CEdit *)GetDlgItem(IDC_EDIT_FLEK ) ĭoes anybody have an idea why and give me a suggestion? Return TRUE // return TRUE unless you set the focus to a control

M_wndMaskEdit.SetWindowTex t(_T("DEST LE ")) M_wndMaskEdit.EnableGetMas kedCharsOn ly(FALSE) M_wndMaskEdit.SetValidChar s(_T("1234 567890")) // Valid string characters _T("DESTLE_"), // Literal, "_" char = character entry M_wndMaskEdit.EnableMask(_ T(" aaaaaaaaaa"), // The mask string VERIFY(m_wndMaskEdit.Subcl assDlgItem ( IDC_EDIT_FLEK, this )) ON_EN_CHANGE(IDC_EDIT_FLEK, OnSelChangeLE) Void CDlgSchlagInfo::DoDataExch ange(CData Exchange* pDX)īEGIN_MESSAGE_MAP(CDlgSchl agInfo, CDialog) M_wndMaskEdit.GetWindowTex t(m_strFLE K)

Then I change it to DESTLE12, use GetWindowText, it returns DESTLE1?Īnd here is my code, IDC_EDIT_FLEK is the name of edit field. For example:Īt start, my string is DESTLE, I change it to DESTLE1, use GetWindowText, it returns DESTLE? And I did this using CMFCMaskedEdit.īut now there is a problem, whenever I change the content of this edit field, and using GetWindowText to get it, it always returns the previous value. I have a edit field, and for this edit field, only 16 characters are allowed, the first 6 stays unchanged, the rest is numbers.
