Click to See Complete Forum and Search --> : CEdit


mrba
May 14th, 1999, 03:53 AM
Can i create two var. in an CEDitBox, i.e an CString and an CEdit ?
if i use the CSting how can i give the handle to the CEdit?.
Please it's urgent??

Stu
May 14th, 1999, 05:56 AM
I assume you are talking about DDX member variables associated with your CEdit.

If thats the case, you can define BOTH a CString and a CEdit member using ClassWizard.

mrba
May 14th, 1999, 09:08 AM
i tried this but i have access to the CString an not to the CEdit
I try to write something with the CString var. and to clear the CEditBox by the CEdit var. there are no effect and debugger wrote {CEdit hWnd = 0x00010478}.

Stu
May 17th, 1999, 05:16 AM
I don't understand what you are trying to do.

> i tried this but i have access to the CString an not to the CEdit

If you added a CEdit member variable using classwizard, you have access to it throughout the scope of your dialog class in the same way as the CString member.

> I try to write something with the CString var.

You mean assign a value to the CString and have it appear in the edit box?

csText = "blah";
UpdateData(FALSE);

- or -

csText = "blah";
m_EditBox.SetWindowText(csText);

> and to clear the CEditBox by the CEdit var

???
m_EditBox.SetWindowText("");

Why not post the code fragment causing the problem...

mrba
May 17th, 1999, 05:25 AM
the problem is solved i need to write before using the CEdit(m_edit) var
*******************
UpdateData(TRUE);
m_edit.Clear;
********************
and not UpdateData(FALSE); after