The Initialize method initializes the FileSaveAsDlg component by specifying the initial values for the fields on the File Save As dialog, including the dialog title, filename and destination directory, file type filter list, and optional flags to control the dialog behavior.
void spIFileSaveAsDlg->Initialize(_bstr_t bstrTitle,
_bstr_t bstrFileName,
_bstr_t bstrDirectoryName,
_bstr_t bstrFilterList,
long lFilterIndex,
VARIANT vFlags);
...
// Specify the initial values for the dialog input fields
_bstr_t bstrTitle = (_T("Save the Downloaded File As..."));
_bstr_t bstrFileName = (_T("filename"));
_bstr_t bstrDirectoryName = (_T("C:\Downloaded Documents\"));
_bstr_t bstrFilterList(_T( "Device Independent Bitmap (*.bmp)|*.bmp|
GIF Graphics Interchange Format (*.gif)|*.gif|
JPEG File Interchange Format (*.jpg)|*.jpg|
Microsoft PowerPoint (*.ppt)|*.ppt|
Microsoft Word (*.doc)|*.doc|
Outline/RTF (*.rtf)|*.rtf|
Web Page (*.htm;*.html)|*.htm;*.html"));
long lFilterIndex = 0L;
// * Specify the optional control flags here
VARIANT vFlags = "";
// Initialize the FileSaveAsDlg component
std::cout << "Initializing the FileSaveAsDlg component..." << std::endl;
spIFileSaveAsDlg->Initialize(bstrTitle, bstrFileName, bstrDirectoryName, bstrFilterList, lFilterIndex, vFlags);
...