Solved

UpdateData(false) in a editbox

Posted on 2004-04-15
6
826 Views
Last Modified: 2013-11-20
I want to UpdateData(false) but only for one of the CEdit Boxes in my Dialog;
I tried:
                CString m_Bild=AnyString; //Value of that CEdit Box
      CEdit m_BildCtrl.UpdateData(false); //Control of that CEdit Box

but it dont updates the data.

0
Comment
Question by:dkloeck
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10838005
try m_BildCtrl.UpdateData (TRUE)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10838105
The parameter to UpdateData() is called bSaveAndValidate. This means that if this parameter is set to true, you are retrieving data from the control (and validating it). If you set it to false, you are setting the the control (copying from your variable to the control).

Which way do you want your data to go?

The line that you quoted will not work. You need to do it like this:
m_BildCtrl.UpdateData(false);
0
 
LVL 4

Accepted Solution

by:
bkfirebird earned 30 total points
ID: 10838253
oops .... you're right khkremer .... it should actually be UpdateData (false) .... what was i thinking

it that doesnt work simply use
m_BildCtrl.SetWindowText (m_Bild)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10838336
I usually get this wrong myself :-) That's why I try to remember the "validate" part of the parameter name. Validation only makes sense when reading from the control, so "true" therefore must be control->variable
0
 
LVL 8

Expert Comment

by:martynjpearson
ID: 10839816
UpdateData takes a BOOL not a bool, so strictly speaking you should pass TRUE or FALSE, rather than true or false.

Call me pedantic....!
Martyn
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10840643
martynjpearson, you are pedantic :-) But you are of course right. I do however only use true and false in my code, and (besides the occasional warning) it does not make a difference. I am used to a "real" C++ environment :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 84
Named range not carried over 10 62
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 74
Making an alias 7 80
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now