Problem in Dialog Based app
------------------------------------

The dialog based app has a main wiondow and the child window needs a variable from the parent window. I notice that though I instantiate an object of the parent window and access the variable . the resulting variable is "empty".

// CmainDialog.cpp class derived from CDialog

void CMainDialog::setVar()
{
char* m_var = "Number of People";
}

//CNext.cpp class derived from CDialog

void CNext::OnOK()
{

UpDateData(TRUE);
CMainDialog dlg;
CString myvar;

myvar = (CString)dlg.getVar(); // This variable is empty.

}

Can somebody please help me out here ??

I rate ALL posts .
Thanks ,
Kamath.