IDlgResults Interface

After the IFileSaveAsDlg interface has been used to display the File Save As dialog, the IDlgResults interface is used to retrieve the values that were entered in the dialog by the user.

Reference

DLL FnAppIntOpenSaveDlg.dll
See Also

IFileSaveAsDlg Interface, Upload and Download commands

Methods

The IDlgResults interface defines the following methods:

Method Description
GetDirectoryName Returns the destination directory entered by the user.
GetErrorCode Returns the error code that resulted from attempting to display the dialog.
GetErrorMessage Returns the description of the error that occurred when attempting to display the dialog.
GetFileName Returns the file name entered by the user.
GetFilterIndex Returns the file type selected by the user.
GetFlags Returns the flags specified to control the dialog behavior.
GetFullPathName Returns a combination of the filename and destination directory entered by the user.

Example

The following is a fragment from the complete example for the Upload command, which utilizes a DlgResults component.

   ...
   // Invoke the FileSaveAsDlg component to display the File Save As dialog
   std::cout << "Attempting to display the File Save As dialog..." << std::endl;
   hResult = spIFileSaveAsDlg->DoModal();
   if (FAILED(hResult)) {
      std::cout << "Could not create the File Save As dialog.\n";
      _ASSERTE(0);
   } else {
      // Retrieve the filename and destination directory entered by the user
      IDlgResultsPtr spIDlgResults(spIFileSaveAsDlg);
      std::cout << "FileName=" << (LPCSTR) spIDlgResults->GetFileName() << std::endl;
      std::cout << "DirectoryName=" << (LPCSTR) spIDlgResults->GetDirectoryName() << std::endl;
      std::cout << "FullPathName=" << (LPCSTR) spIDlgResults->GetFullPathName() << std::endl;
      std::cout << "FilterIndex=" << spIDlgResults->GetFilterIndex() << std::endl;
      std::cout << "ErrorCode=" << spIDlgResults->GetErrorCode() << std::endl;
      std::cout << "ErrorMessage=" << (LPCSTR) spIDlgResults->GetErrorMessage() << std::endl;
      std::cout << "Flags=" << spIDlgResults->GetFlags() << std::endl;
   }
   ...