|
-
October 14th, 2004, 01:20 AM
#2
Re: Which is best? (by Optimization & Speed)
 Originally Posted by DjChris14
Which is better among them? GetDlgItem or Creating Control Variable?
It's a tradeoff - using DDX variables is the better design, leads to less code, and it is safer, since you don't have to test whether the control exists and if it is of the right type. OTOH, calling UpdateData is generally slower, since it transfers data for all the controls in the dialog. Besides that, there are situations where you can't use UpdateData() since you don't want to update other controls, so you can't use UpdateData.
What I don't understand in your question: You are talking about control variables (like CEdit, CListCtrl), not DDX data members (like CString, int) - note that for DDX control members, UpdateData() does nothing, DDX just creates and attaches the control at the beginning. In that case, I don't see any advantage in using GetDlgItem ().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|