Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To ask the user information via keyboard Pin
antonio34313-Oct-11 14:38
antonio34313-Oct-11 14:38 
GeneralRe: To ask the user information via keyboard Pin
antonio34314-Oct-11 23:10
antonio34314-Oct-11 23:10 
QuestionIdea of Activation of software Pin
002comp12-Oct-11 2:02
002comp12-Oct-11 2:02 
AnswerRe: Idea of Activation of software Pin
Rajesh R Subramanian12-Oct-11 3:01
professionalRajesh R Subramanian12-Oct-11 3:01 
AnswerRe: Idea of Activation of software Pin
Chuck O'Toole12-Oct-11 4:33
Chuck O'Toole12-Oct-11 4:33 
AnswerRe: software protection and activation Pin
Software_Developer12-Oct-11 21:38
Software_Developer12-Oct-11 21:38 
GeneralRe: software protection and activation Pin
002comp13-Oct-11 0:59
002comp13-Oct-11 0:59 
Questionchanging column value to hyper link Pin
VCProgrammer12-Oct-11 1:24
VCProgrammer12-Oct-11 1:24 
AnswerRe: changing column value to hyper link Pin
Richard MacCutchan12-Oct-11 1:59
mveRichard MacCutchan12-Oct-11 1:59 
GeneralRe: changing column value to hyper link Pin
VCProgrammer12-Oct-11 2:05
VCProgrammer12-Oct-11 2:05 
AnswerRe: changing column value to hyper link Pin
Rolf Kristensen12-Oct-11 2:21
Rolf Kristensen12-Oct-11 2:21 
AnswerRe: my two cents Pin
Software_Developer12-Oct-11 21:50
Software_Developer12-Oct-11 21:50 
QuestionCompression Algorithem Sites Pin
Game-point12-Oct-11 0:04
Game-point12-Oct-11 0:04 
AnswerRe: Compression Algorithem Sites Pin
André Kraak12-Oct-11 1:15
André Kraak12-Oct-11 1:15 
AnswerRe: Compression Algorithem Sites Pin
Game-point13-Oct-11 19:59
Game-point13-Oct-11 19:59 
QuestionLANGID to wstring Pin
zon_cpp11-Oct-11 23:42
zon_cpp11-Oct-11 23:42 
AnswerRe: LANGID to wstring Pin
Randor 11-Oct-11 23:54
professional Randor 11-Oct-11 23:54 
QuestionMFC - how to get an edit box text from another dialog?? (Constructor) Pin
symeramon11-Oct-11 20:58
symeramon11-Oct-11 20:58 
AnswerRe: DDX_Text Pin
App_11-Oct-11 21:42
App_11-Oct-11 21:42 
AnswerRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
enhzflep11-Oct-11 21:43
enhzflep11-Oct-11 21:43 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
Richard MacCutchan11-Oct-11 21:46
mveRichard MacCutchan11-Oct-11 21:46 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
enhzflep11-Oct-11 23:31
enhzflep11-Oct-11 23:31 
AnswerRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
Madhu Nair11-Oct-11 21:44
Madhu Nair11-Oct-11 21:44 
Keep a public CString member variable in Child dialog class, set the member variable before calling the DoModal() or Create function of child dialog. Call SetWindowText of edit control in InitDialog.

for. eg

If CMainDlg is your Main dialog class and CChildDialog be the child.
in header of CChildDialog you declare a public member variable to hold the string
C++
class CChildDialog : public CDialog
{
 public :
 CString m_strText;
}

and in your button click function of CMainDlg do this

C++
void CMainDlg::OnClick_Button()
{
  
  CChildDialog oChildDlg; 
  oChildDlg.m_strText = strText; // This should be the edit box value
  oChildDlg.DoModal();
}


Set the variable value in CChildDialog's OnInitDialog as

C++
CChildDialog::OnInitDialog()
{
  SetDlgItemText(ID_OF_YOUR_EDIT, m_strText);
}


You can also set the text by modifying your constructor of CChildDialog, such as
C++
CChildDialog::CChildDialog(CString strText)

GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
symeramon11-Oct-11 22:14
symeramon11-Oct-11 22:14 
AnswerRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
Richard MacCutchan11-Oct-11 21:45
mveRichard MacCutchan11-Oct-11 21:45 

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.