Hi,
solution1:
i do not know why you want to create two dialog boxes for getting file path.you can get full file path from same edit box and you can create the file.still if you want to separate file and directory, use same dialog having two edit boxes.
Solution 2:
if it is your requirement to use two dialog boxes as in your example,then you can do it in two ways.
1.after creating your directory pass the path to your second dialog.for this there are lot of options,one way is using your own constructor of second dialog.
Or
2.after creating second dialog you take the file name(like the directory from first dialog).use this value in first dialog to create the file.here goes the idea,
in first dialog
filedialog.DoModal();
CString name=filedialog.filename;
in second dialog create a DDX_Text variable with name filename for file name edit box.on button click handler use
onok();
now you can create a file path in first dialog,so that the whole creation part goes to first dialog.i suggest you try this one.
I think its better not use global variables he you have another solutions.