Click here to Skip to main content
15,921,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog Controls Pin
LCI4-Oct-05 5:50
LCI4-Oct-05 5:50 
GeneralRe: Dialog Controls Pin
bugDanny4-Oct-05 5:57
bugDanny4-Oct-05 5:57 
AnswerRe: Dialog Controls Pin
Trollslayer4-Oct-05 6:42
mentorTrollslayer4-Oct-05 6:42 
QuestionInserting text into text box Pin
si_694-Oct-05 4:54
si_694-Oct-05 4:54 
AnswerRe: Inserting text into text box Pin
Maximilien4-Oct-05 5:27
Maximilien4-Oct-05 5:27 
GeneralRe: Inserting text into text box Pin
si_694-Oct-05 5:38
si_694-Oct-05 5:38 
GeneralRe: Inserting text into text box Pin
bugDanny4-Oct-05 5:44
bugDanny4-Oct-05 5:44 
AnswerRe: Inserting text into text box Pin
bugDanny4-Oct-05 5:36
bugDanny4-Oct-05 5:36 
Is the text box an edit box? If so, you need to create a member variable for it. You have two choices, CString or CEdit. If it's a CString (e.g m_var) then,
CMyDialog::OnButton(){
UpdateData(TRUE);
int n = m_var.Insert(0, "Name to be inserted");
ASSERT(n == m_var.GetLength());
UpdateData(FALSE);
}
So that when the button is pressed, the program gets the current text in the edit box, you insert the substring at the index indicated by the first argument to Insert() (in this example 0). UpdateData(FALSE) updates the dialog with the new text.

If you use CEdit, you can do something like,
CString temp;
m_var.GetWindowText(temp);
temp.Insert(0, "Name to be inserted");
m_var.SetWindowText(temp);
And this should display the new text with the name inserted.

Danny

The stupidity of others amazes me!
GeneralRe: Inserting text into text box Pin
si_694-Oct-05 5:42
si_694-Oct-05 5:42 
GeneralRe: Inserting text into text box Pin
bugDanny4-Oct-05 5:51
bugDanny4-Oct-05 5:51 
AnswerRe: Inserting text into text box Pin
David Crow4-Oct-05 8:29
David Crow4-Oct-05 8:29 
QuestionHow to get COM Variants International Pin
the_grip4-Oct-05 4:33
the_grip4-Oct-05 4:33 
QuestionTwo CPU's Pin
Richard Hudson4-Oct-05 4:12
Richard Hudson4-Oct-05 4:12 
AnswerRe: Two CPU's Pin
David Crow4-Oct-05 4:21
David Crow4-Oct-05 4:21 
GeneralRe: Two CPU's Pin
Richard Hudson4-Oct-05 4:43
Richard Hudson4-Oct-05 4:43 
AnswerRe: Two CPU's Pin
Bob Stanneveld4-Oct-05 7:44
Bob Stanneveld4-Oct-05 7:44 
AnswerRe: Two CPU's Pin
Blake V. Miller4-Oct-05 9:10
Blake V. Miller4-Oct-05 9:10 
Questionhow to convert unsigned char to COleVariant type Pin
snprani4-Oct-05 3:36
snprani4-Oct-05 3:36 
AnswerRe: how to convert unsigned char to COleVariant type Pin
John M. Drescher4-Oct-05 5:32
John M. Drescher4-Oct-05 5:32 
QuestionAcquireCredentialsHandle returns SEC_E_INTERNAL_ERROR Pin
sunit54-Oct-05 2:10
sunit54-Oct-05 2:10 
Questionhelp plz tell url of COM ebooks Pin
Anonymous4-Oct-05 1:33
Anonymous4-Oct-05 1:33 
JokeRe: help plz tell url of COM ebooks Pin
toxcct4-Oct-05 3:33
toxcct4-Oct-05 3:33 
QuestionHow to create a HUGE 2d array? Pin
Member 17264404-Oct-05 1:16
Member 17264404-Oct-05 1:16 
AnswerRe: How to create a HUGE 2d array? Pin
Trollslayer4-Oct-05 1:24
mentorTrollslayer4-Oct-05 1:24 
AnswerRe: How to create a HUGE 2d array? Pin
John M. Drescher4-Oct-05 2:49
John M. Drescher4-Oct-05 2:49 

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.