|
-
April 28th, 1999, 08:19 PM
#1
CFileDialog
I want the CFileDialog dialog to be looking at a predetermine folder whenit first opens instead of the folder that the application is running. How do I do that.
Thanks
Jim Bassett
-
April 28th, 1999, 11:45 PM
#2
Re: CFileDialog
hai,
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );
while creating a object for CFiledialog the third parameter in the constructor
you pass you can give the path you required to come when the file dialog
pops up.
satish
-
April 28th, 1999, 11:59 PM
#3
Re: CFileDialog
Hi!
CFileDialog::m_ofn is a structure of type OPENFILENAME. Use this structure to initialize the appearance of a File Open or File Save As dialog box after it is constructed but before it is displayed with the DoModal member function. You can set the lpstrInitialDir member of m_ofn to the directory you want the dialog box to point to initially.
The following code shd solve your problem :
CFileDialog FilePath(TRUE);
FilePath.m_ofn.lpstrInitialDir = "D:\\"; //Set the value of lpstrInitialDir to the predeterminate folder U want it to point to.
FilePath.DoModal();
Do let me know if it works.
Regards,
Sukanya Swaminathan
Software Engineer
Aditi Technologies
Blr - 80
Email :[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|