Udostępnij za pośrednictwem


COleInsertDialog::DoModal

Call this function to display the OLE Insert Object dialog box.

virtual INT_PTR 
   DoModal();
INT_PTR 
   DoModal(
   DWORD dwFlags 
);

Parameters

  • dwFlags
    One of the following values:

    COleInsertDialog::DocObjectsOnly inserts only DocObjects.

    COleInsertDialog::ControlsOnly inserts only ActiveX controls.

    Zero inserts neither a DocObject nor an ActiveX control. This value results in the same implementation as the first prototype listed above.

Return Value

Completion status for the dialog box. One of the following values:

  • IDOK if the dialog box was successfully displayed.

  • IDCANCEL if the user canceled the dialog box.

  • IDABORT if an error occurred. If IDABORT is returned, call the COleDialog::GetLastError member function to get more information about the type of error that occurred. For a listing of possible errors, see the OleUIInsertObject function in the Windows SDK.

Remarks

If you want to initialize the various dialog box controls by setting members of the m_io structure, you should do this before calling DoModal, but after the dialog object is constructed.

If DoModal returns IDOK, you can call other member functions to retrieve the settings or information input into the dialog box by the user.

Requirements

Header: afxodlgs.h

See Also

Reference

COleInsertDialog Class

Hierarchy Chart

COleDialog::GetLastError

CDialog::DoModal

COleInsertDialog::GetSelectionType

COleInsertDialog::GetClassID

COleInsertDialog::GetDrawAspect

COleInsertDialog::GetIconicMetafile

COleInsertDialog::GetPathName

COleInsertDialog::m_io

Other Resources

COleInsertDialog Members

Change History

Date

History

Reason

February 2009

Fixed spelling of the DocObjectsOnly constant.

Customer feedback.