Click here to Skip to main content
16,008,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dialog help Pin
_AnsHUMAN_ 7-Jul-08 22:22
_AnsHUMAN_ 7-Jul-08 22:22 
GeneralRe: dialog help Pin
projectip7-Jul-08 22:36
projectip7-Jul-08 22:36 
GeneralRe: dialog help Pin
_AnsHUMAN_ 7-Jul-08 23:02
_AnsHUMAN_ 7-Jul-08 23:02 
GeneralRe: dialog help Pin
projectip7-Jul-08 23:17
projectip7-Jul-08 23:17 
GeneralRe: dialog help Pin
_AnsHUMAN_ 7-Jul-08 23:32
_AnsHUMAN_ 7-Jul-08 23:32 
GeneralRe: dialog help Pin
projectip8-Jul-08 0:17
projectip8-Jul-08 0:17 
GeneralRe: dialog help [modified] Pin
Varghese Paul M8-Jul-08 1:16
Varghese Paul M8-Jul-08 1:16 
AnswerRe: dialog help Pin
Rajesh R Subramanian8-Jul-08 0:52
professionalRajesh R Subramanian8-Jul-08 0:52 
May be you could have an overloaded constructor for your second dialog, which accepts a pointer to a string. Smile | :)

Step 1: In your first dialog:
#include "NewDlg.h" //Header of the new dialog

CString cst;
CNewDlg cnd(&cst);
if(cnd.DoModal() == IDOK);
   AfxMessageBox(cst);

Step 2: Overloaded constructor of the new dialog:
CNewDlg::CNewDlg(CString *str, CWnd *pParent):
CDialog(CNewDlg::IDD, pParent), m_str(str)
//m_str is a member variable, defined as CString *m_str;
{
}

Step 3: In the OnOK() handler of the second dialog:
CString szVal;
m_edit.GetWindowText(szVal); //m_edit is a control variable.
*m_str = szVal;
CDialog::OnOK();


A crude way, but it works. Smile | :)

Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.


Microsoft MVP - Visual C++[^]

QuestionGet focus Pin
iayd7-Jul-08 21:50
iayd7-Jul-08 21:50 
AnswerRe: Get focus Pin
Yajnesh Narayan Behera8-Jul-08 1:54
Yajnesh Narayan Behera8-Jul-08 1:54 
Questionits showing Error ? Pin
nisha000007-Jul-08 21:24
nisha000007-Jul-08 21:24 
AnswerRe: its showing Error ? Pin
_AnsHUMAN_ 7-Jul-08 21:44
_AnsHUMAN_ 7-Jul-08 21:44 
Questionhow to know which port is being used by which process with windows API? Pin
ZhiLiangLin7-Jul-08 21:08
ZhiLiangLin7-Jul-08 21:08 
AnswerRe: how to know which port is being used by which process with windows API? Pin
_AnsHUMAN_ 7-Jul-08 21:48
_AnsHUMAN_ 7-Jul-08 21:48 
QuestionVisual Studio remote debugging Pin
George_George7-Jul-08 20:16
George_George7-Jul-08 20:16 
Questionwhy can't we declare data member of class auto register or extern Pin
rajneshmalik7-Jul-08 20:07
rajneshmalik7-Jul-08 20:07 
AnswerRe: why can't we declare data member of class auto register or extern Pin
Mark Salsbery8-Jul-08 6:53
Mark Salsbery8-Jul-08 6:53 
GeneralRe: why can't we declare data member of class auto register or extern Pin
rajneshmalik8-Jul-08 18:27
rajneshmalik8-Jul-08 18:27 
GeneralRe: why can't we declare data member of class auto register or extern Pin
Mark Salsbery9-Jul-08 5:43
Mark Salsbery9-Jul-08 5:43 
QuestionCompare two XML Files Pin
manju#1237-Jul-08 19:29
manju#1237-Jul-08 19:29 
AnswerRe: Compare two XML Files Pin
Sarath C7-Jul-08 19:56
Sarath C7-Jul-08 19:56 
GeneralRe: Compare two XML Files Pin
manju#1237-Jul-08 20:31
manju#1237-Jul-08 20:31 
Questionhelp in vc++(files) Pin
projectip7-Jul-08 19:04
projectip7-Jul-08 19:04 
AnswerRe: help in vc++(files) Pin
_AnsHUMAN_ 7-Jul-08 19:22
_AnsHUMAN_ 7-Jul-08 19:22 
GeneralRe: help in vc++(files) Pin
projectip7-Jul-08 19:27
projectip7-Jul-08 19:27 

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.