Passing values from one Dialog to Another.
-
Hi,, In my Project I have main Dialog DesktopSearchDlg CreateDlg & UpdateDlg. In CreateDlg I am accepting File Name on Ok I have to add the file name to UpdateDlg in a combo box Can any one please tell me how to do this. CreateDlg UpdateDlg File Name onOK ( ) ComboBox Regards, Parichay.
-
Hi,, In my Project I have main Dialog DesktopSearchDlg CreateDlg & UpdateDlg. In CreateDlg I am accepting File Name on Ok I have to add the file name to UpdateDlg in a combo box Can any one please tell me how to do this. CreateDlg UpdateDlg File Name onOK ( ) ComboBox Regards, Parichay.
hi, steps to capture the filename from the first dialog (CreateDlg) 1) store the Filename in the CString Variable before the Ok Button was Pressed. 2) In OnInitDialog of the Second Dialog i mean (UpdateDlg) create a an Object of the First Dialog (CreateDialog) : //============================================================== (ie) CreateDialog *mpmain = (CreateDialog *)GetParent(); CString str = mpmain->filenamemembervarialbe; ComboBox.Addstring(str); //Adding to ComboBox in SecondDialog //============================================================== over, Good Luck. uday. uday kiran
-
Hi,, In my Project I have main Dialog DesktopSearchDlg CreateDlg & UpdateDlg. In CreateDlg I am accepting File Name on Ok I have to add the file name to UpdateDlg in a combo box Can any one please tell me how to do this. CreateDlg UpdateDlg File Name onOK ( ) ComboBox Regards, Parichay.
Hope I understood your question if you need to value or variable from DesktopSearchDlg in CreateDlg http://www.codeproject.com/script/comments/forums.asp?msg=1447977&forumid=1647&XtraIDs=1647&searchkw=Getparent&sd=1%2F25%2F2005&ed=4%2F25%2F2006#xx1447977xx[^]
-
hi, steps to capture the filename from the first dialog (CreateDlg) 1) store the Filename in the CString Variable before the Ok Button was Pressed. 2) In OnInitDialog of the Second Dialog i mean (UpdateDlg) create a an Object of the First Dialog (CreateDialog) : //============================================================== (ie) CreateDialog *mpmain = (CreateDialog *)GetParent(); CString str = mpmain->filenamemembervarialbe; ComboBox.Addstring(str); //Adding to ComboBox in SecondDialog //============================================================== over, Good Luck. uday. uday kiran
Hi, Thanks for the reply.. I just store the file name as below void CCreateDlg::OnOk() { CString fname; fname=m_FILE_NAME; -- --- --- } Now in the UpdateDlg In the BOOL CUpdateDlg::OnInitDialog() { } ---- I want to know what is *mpmain ??? is this MainDialog window ???
-
Hi, Thanks for the reply.. I just store the file name as below void CCreateDlg::OnOk() { CString fname; fname=m_FILE_NAME; -- --- --- } Now in the UpdateDlg In the BOOL CUpdateDlg::OnInitDialog() { } ---- I want to know what is *mpmain ??? is this MainDialog window ???
hi, yes it is Main Window Dialog you are correct. also when you want to access the Mainwindow Dialog in second dialog dont forget to include the first dialog header in second dialog. ie (i mean) # include "firstDialog.h" in the second Dialog. good luck. uday. uday kiran
-
hi, yes it is Main Window Dialog you are correct. also when you want to access the Mainwindow Dialog in second dialog dont forget to include the first dialog header in second dialog. ie (i mean) # include "firstDialog.h" in the second Dialog. good luck. uday. uday kiran
Hi, I am bit confused now. In my project the main Dialog is CDesktopSearchDlg after that i have CreateDlg & UpdateDlg. //Uday firstDialog.h" in the second Dialog. // i want to which is first dialog and which is 2nd dialog. Is this code below correct ?? BOOL CUpdateDlg::OnInitDialog() { CDialog::OnInitDialog(); CreateDlg *CDesktopSearchDlg = (CreateDlg *)GetParent(); CString str = CDesktopSearchDlg->fname; m_UPDATE_FILE_NAME_COMBO.AddString(str); }
-
Hope I understood your question if you need to value or variable from DesktopSearchDlg in CreateDlg http://www.codeproject.com/script/comments/forums.asp?msg=1447977&forumid=1647&XtraIDs=1647&searchkw=Getparent&sd=1%2F25%2F2005&ed=4%2F25%2F2006#xx1447977xx[^]
can u please tell what is the error ??? -> error CCreateDlg *CCreateDlg = (CCreateDlg*)GetParent(); CString str = CCreateDlg -> fname; m_UPDATE_FILE_NAME_COMBO.AddString(str); --------------------Configuration: DesktopSearch - Win32 Debug-------------------- Compiling... UpdateDlg.cpp D:\Parichay\DS with Help\DesktopSearch\UpdateDlg.cpp(146) : error C2059: syntax error : ')' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s)
-
Hi, I am bit confused now. In my project the main Dialog is CDesktopSearchDlg after that i have CreateDlg & UpdateDlg. //Uday firstDialog.h" in the second Dialog. // i want to which is first dialog and which is 2nd dialog. Is this code below correct ?? BOOL CUpdateDlg::OnInitDialog() { CDialog::OnInitDialog(); CreateDlg *CDesktopSearchDlg = (CreateDlg *)GetParent(); CString str = CDesktopSearchDlg->fname; m_UPDATE_FILE_NAME_COMBO.AddString(str); }
hi, there is no confusion at all, from which dialog you want to access the control values ((ie) the String value of the File Name) just create an instance of the dialog and access the control values. good luck. uday. uday kiran
-
hi, there is no confusion at all, from which dialog you want to access the control values ((ie) the String value of the File Name) just create an instance of the dialog and access the control values. good luck. uday. uday kiran
can u please tell what is the error ??? is this below code correct??? -> error CCreateDlg *CCreateDlg = (CCreateDlg*)GetParent(); CString str = CCreateDlg -> fname; m_UPDATE_FILE_NAME_COMBO.AddString(str); --------------------Configuration: DesktopSearch - Win32 Debug-------------------- Compiling... UpdateDlg.cpp D:\Parichay\DS with Help\DesktopSearch\UpdateDlg.cpp(146) : error C2059: syntax error : ')' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s)
-
can u please tell what is the error ??? -> error CCreateDlg *CCreateDlg = (CCreateDlg*)GetParent(); CString str = CCreateDlg -> fname; m_UPDATE_FILE_NAME_COMBO.AddString(str); --------------------Configuration: DesktopSearch - Win32 Debug-------------------- Compiling... UpdateDlg.cpp D:\Parichay\DS with Help\DesktopSearch\UpdateDlg.cpp(146) : error C2059: syntax error : ')' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s)
hi parichay, change the Class instance and Class to Different values. you are using CCreateDlg class name and Member varible as same which is confusing. please change the values as //========================================================================== CreateDlg *pCreateDlg = (CreateDlg *) GetParent(); CString szStr = pCreateDlg->fname; //========================================================================== check with it. good luck, uday. uday kiran