CFileDialog::GetIFileOpenDialog

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

IFileOpenDialog* GetIFileOpenDialog();

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 returns NULL if the CFileDialog is not an Open 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 IFileOpenDialog interface, see IFileOpenDialog.

Example

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

// Get the interface pointer
IFileOpenDialog * openDlgPtr = m_myFileDialogPtr->GetIFileOpenDialog();

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

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

Requirements

Minimum required operating system:Windows Vista

Header: afxdlgs.h

See Also

Concepts

CFileDialog Class

CFileDialog Members

Hierarchy Chart

CFileDialog::GetIFileDialogCustomize

CFileDialog::GetIFileSaveDialog