I am writing a program to batch rename files.

I have a dialog box that gets the folder path from the user. I want to pass that back to the parent window.

I need to know how to link the 2 windows and get the text from the dialog box.


If you're using VC++, you need to associate a variable with the editbox that contains the path. From parent you should be doing:

YourDialogClass obj ;
obj.doModal() ; //or something like that
//Prev call returns when user has selected the path and pressed Ok/Cancel.
//Also in the onOk() of dialog you'll do UpdateData() which will update the variable with the value in edit box.
cout << "Path selected by user is: " << obj.theStringVariableForEditBox << endl ;

AFAIK there are predefined dialog classes available for path selection. If that's true i'm sure you'll find example code as well..