Click here to Skip to main content
15,913,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPE explorer Pin
V.G26-Mar-05 6:00
V.G26-Mar-05 6:00 
GeneralRe: PE explorer Pin
David Crow26-Mar-05 7:21
David Crow26-Mar-05 7:21 
QuestionHow to send right control to an application Pin
d00peter26-Mar-05 5:58
d00peter26-Mar-05 5:58 
AnswerRe: How to send right control to an application Pin
Blake Miller28-Mar-05 5:31
Blake Miller28-Mar-05 5:31 
GeneralRe: How to send right control to an application Pin
d00peter28-Mar-05 21:19
d00peter28-Mar-05 21:19 
GeneralRe: How to send right control to an application Pin
Blake Miller29-Mar-05 5:05
Blake Miller29-Mar-05 5:05 
GeneralRe: How to send right control to an application Pin
d00peter30-Mar-05 0:55
d00peter30-Mar-05 0:55 
GeneralMFC CWnd::UpdateData() question Pin
toxcct26-Mar-05 4:14
toxcct26-Mar-05 4:14 
here is how I understand the job of this function :

Let's say I have an EditBox (which ID is IDC_MYEDIT),a pointer to that CEdit (called m_pMyEdit) and a CString object (called m_strEditText) associated to the control by DDX (DDX_Text (pDX, IDC_MYEDIT, m_strEditText);).

When I call UpdateData(TRUE), IDC_MYEDIT is filled with the content of m_strEditText.
When I call UpdateData(FALSE), m_strEditText is affected with the content of IDC_MYEDIT.

until there, am I still right ?


Now, here is my problem:

<font color=#0000FF>void</font> CMyClass::OnEditMyEdit() {
    UpdateData();    <font color=#008000>// UpdateData(TRUE)</font>
    <font color=#0000FF>int</font> iStartSel = m_strEditText.GetLength();
 
    <font color=#008000>// Find if the string typed in IDC_MYEDIT is the begining of
    // another string reached in the list box of a CComboBox...</font>
 
    m_strEditText = <font color=#008000>/* String found in the combo box */</font>;
    UpdateData(FALSE);
    m_pMyEdit->SetSel(iStartSel, -1);
}
This code is supposed to search for the string typed in the EditBox into a ComboBox, complete the string, then select its content that was added programatically (I try here - maybe you understood it - to make an auto-complete with a case sensitive behavior).
The problem is that, if I use UpdateData(FALSE), the completion is not what I expect.
However, if replace
UpdateData(FALSE);
with
m_pMyEdit->SetWindowText(m_strEditText);
, my function works exactly as I want of it...

Did I misunderstood how UpdateData() worked ?
Did anybody encountered such a problem, or a problem with This function ?



TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: MFC CWnd::UpdateData() question Pin
David Crow26-Mar-05 7:23
David Crow26-Mar-05 7:23 
GeneralRe: MFC CWnd::UpdateData() question Pin
Michael Dunn26-Mar-05 9:44
sitebuilderMichael Dunn26-Mar-05 9:44 
GeneralRe: MFC CWnd::UpdateData() question Pin
toxcct28-Mar-05 7:56
toxcct28-Mar-05 7:56 
GeneralCopy class (derived from CObject) Pin
AnTri26-Mar-05 2:19
AnTri26-Mar-05 2:19 
GeneralRe: Copy class (derived from CObject) Pin
toxcct26-Mar-05 4:11
toxcct26-Mar-05 4:11 
GeneralVisual C++ Pointers Pin
Usman Arif26-Mar-05 2:18
Usman Arif26-Mar-05 2:18 
GeneralRe: Visual C++ Pointers Pin
Maximilien26-Mar-05 3:38
Maximilien26-Mar-05 3:38 
GeneralRe: Visual C++ Pointers Pin
MMansonFan2529-Mar-05 23:10
MMansonFan2529-Mar-05 23:10 
GeneralProblem with ActiveX control's initial size(Please read this , i need this for my final year project) Pin
Faisal Sajjad26-Mar-05 1:13
Faisal Sajjad26-Mar-05 1:13 
GeneralLogic Question Pin
RedDragon2k26-Mar-05 1:12
RedDragon2k26-Mar-05 1:12 
GeneralRe: Logic Question Pin
toxcct26-Mar-05 4:13
toxcct26-Mar-05 4:13 
GeneralRe: Logic Question Pin
RedDragon2k26-Mar-05 5:54
RedDragon2k26-Mar-05 5:54 
GeneralRe: Logic Question Pin
Roger Wright26-Mar-05 6:43
professionalRoger Wright26-Mar-05 6:43 
GeneralRe: Logic Question Pin
RedDragon2k26-Mar-05 8:59
RedDragon2k26-Mar-05 8:59 
GeneralRe: Logic Question Pin
Roger Wright26-Mar-05 20:46
professionalRoger Wright26-Mar-05 20:46 
GeneralRe: Logic Question Pin
RedDragon2k27-Mar-05 1:24
RedDragon2k27-Mar-05 1:24 
GeneralRe: Logic Question Pin
Roger Wright27-Mar-05 4:20
professionalRoger Wright27-Mar-05 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.