Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
symeramon11-Oct-11 22:21
symeramon11-Oct-11 22:21 
AnswerRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
David Crow12-Oct-11 3:10
David Crow12-Oct-11 3:10 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
symeramon12-Oct-11 3:43
symeramon12-Oct-11 3:43 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
symeramon12-Oct-11 3:48
symeramon12-Oct-11 3:48 
GeneralRe: MFC - how to get an edit box text from another dialog?? (Constructor) Pin
Chandrasekharan P12-Oct-11 21:38
Chandrasekharan P12-Oct-11 21:38 
QuestionLANGID Pin
zon_cpp11-Oct-11 20:52
zon_cpp11-Oct-11 20:52 
AnswerRe: LANGID Pin
Richard MacCutchan11-Oct-11 21:42
mveRichard MacCutchan11-Oct-11 21:42 
AnswerRe: LANGID Pin
Richard MacCutchan11-Oct-11 23:18
mveRichard MacCutchan11-Oct-11 23:18 

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.