次の方法で共有


Dialog Boxes in OLE

OverviewHow Do I

While a user runs an OLE-enabled application, there are times when the application needs information from the user in order to carry out the operation. The MFC OLE classes provide a number of dialog boxes to gather the required information. This article lists the tasks handled by the OLE dialog boxes and the classes needed to display those dialog boxes. For full details on OLE dialog boxes and the structures used to customize their behavior, see the Class Library Reference and see the User Interface Dialog Help (OLE2UI.HLP) file included with the OLE SDK.

Insert Object

This dialog box allows the user to insert newly created or existing objects into the compound document. It also allows the user to choose to display the item as an icon and enables the Change Icon command button. Display this dialog box when the user chooses Insert Object from the Edit menu. Use the class to display this dialog box. Note that you cannot insert an MDI application into itself. An application that is a container/server cannot be inserted into itself unless it is an SDI application.

Paste Special

This dialog box allows the user to control the format used when pasting data into a compound document. The user can choose the format of the data, whether to embed or link the data, and whether to display it as an icon. Display this dialog box when the user chooses Paste Special from the Edit menu. Use the class to display this dialog box.

Change Icon

This dialog box allows the user to select which icon is displayed to represent the linked or embedded item. Display this dialog box when the user chooses Change Icon from the Edit menu or chooses the Change Icon button in either the Paste Special or Convert dialog boxes. Also display it when the user opens the Insert Object dialog box and chooses Display as Icon. Use the class to display this dialog box.

Convert

This dialog box allows the user to change the type of an embedded or linked item. For example, if you have embedded a metafile in a compound document and later want to use another application to modify the embedded metafile, you can use the Convert dialog box. This dialog box is usually displayed by clicking item type Object on the Edit menu and then, on the cascading menu, clicking Convert. Use the class to display this dialog box. For an example, run the MFC OLE sample .

Edit Links or Update Links

The Edit Links dialog box allows the user to change information about the source of a linked object. The Update Links dialog box verifies the sources of all the linked items in the current dialog box and displays the Edit Links dialog box if necessary. Display the Edit Links dialog box when the user chooses Links from the Edit menu. The Update Links dialog box is usually displayed when a compound document is first opened. Use either the or the class, depending on which dialog box you want to display.

Server Busy or Server Not Responding

The Server Busy dialog box is displayed when the user attempts to activate an item and the server is currently unable to handle the request, usually because the server is in use by another user or task. The Server Not Responding dialog box is displayed if the server does not respond to the activation request at all. These dialog boxes are displayed via COleMessageFilter, based on an implementation of the OLE interface IMessageFilter, and the user can decide whether to attempt the activation request again. Use the class to display this dialog box.

See Also   Life Cycle of a Dialog Box, OLE in MFC: Overview