共用方式為


CFileDialog::GetIFileSaveDialog

Retrieves a pointer to the internal COM object for a given CFileDialog.

IFileSaveDialog* GetIFileSaveDialog();

Return Value

The pointer to the internal COM object for the CFileDialog. It is your responsibility to release this pointer appropriately.

Remarks

Use this function only under Windows Vista with an object that has bVistaStyle set to true. This function will return NULL if the CFileDialog is not a Save dialog box or if bVistaStyle is set to false. In this final case, the function only returns NULL in release mode - in debug mode it will throw an assertion.

For more information about the IFileSaveDialog interface, see IFileSaveDialog.

Example

This example retrieves the internal COM object. To run this code example, you must compile it under Windows Vista.

// Get the interface pointer
IFileSaveDialog * saveDlgPtr = m_myFileDialogPtr->GetIFileSaveDialog();

// Make sure that it is not null 
if ( saveDlgPtr != NULL )
{
    // 
    // Perform any interface functionality here 
    // 

    // Release the pointer
    saveDlgPtr->Release();
}

Requirements

Minimum required operating system: Windows Vista

Header: afxdlgs.h

See Also

Reference

CFileDialog Class

Hierarchy Chart

CFileDialog::GetIFileDialogCustomize

CFileDialog::GetIFileOpenDialog