Dialogs: m_myCtrl.GetWindowText(str) or GetDlgItemText(IDC_MY_CTRL, str)? 
Author Message
 Dialogs: m_myCtrl.GetWindowText(str) or GetDlgItemText(IDC_MY_CTRL, str)?

Hi!

In my dialog classes I can do either,

m_myCtrl.GetWindowText(str);

or

GetDlgItemText (IDC_MY_CTRL, str);

to retrieve the text in an edit box, for example.

In debug builds I often get an ASSERT with the former but not the latter.

Does anyone know the reason for this, and is there any way to make the first
method safer?

TIA



Mon, 03 Sep 2001 03:00:00 GMT  
 Dialogs: m_myCtrl.GetWindowText(str) or GetDlgItemText(IDC_MY_CTRL, str)?
Richard:

What does the ASSERT say? There's always a reason that ASSERT was put there.

David Wilkinson

=====================

Quote:

> Hi!

> In my dialog classes I can do either,

> m_myCtrl.GetWindowText(str);

> or

> GetDlgItemText (IDC_MY_CTRL, str);

> to retrieve the text in an edit box, for example.

> In debug builds I often get an ASSERT with the former but not the latter.

> Does anyone know the reason for this, and is there any way to make the first
> method safer?

> TIA



Sun, 09 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. char **str vs. char *str[]

2. _T(str) vs (CString)str?

3. char *str vs. char str[]

4. c standard regarding char str[ ], str[50] & *str

5. Initialization of structs. The old way memset(str, sizeof(str), 0) is disregarded.

6. Is i = *(int*) *str; /*char* str */ defined?

7. char *str = "a string"; str = "another string"

8. ANN: C++ Str Library updated to 2.1.2

9. Str size to use for temp string

10. Basic Question - char *str V/S int *

11. str function prob

12. remove content of str[100]

 

 
Powered by phpBB® Forum Software