description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: COleConvertDialog Class |
COleConvertDialog Class |
11/04/2016 |
|
|
a7c57714-31e8-4b78-834d-8ddd1b856a1c |
For more information, see the OLEUICONVERT structure in the Windows SDK.
class COleConvertDialog : public COleDialog
Name | Description |
---|---|
COleConvertDialog::COleConvertDialog | Constructs a COleConvertDialog object. |
Name | Description |
---|---|
COleConvertDialog::DoConvert | Performs the conversion specified in the dialog box. |
COleConvertDialog::DoModal | Displays the OLE Change Item dialog box. |
COleConvertDialog::GetClassID | Gets the CLSID associated with the chosen item. |
COleConvertDialog::GetDrawAspect | Specifies whether to draw item as an icon. |
COleConvertDialog::GetIconicMetafile | Gets a handle to the metafile associated with the iconic form of this item. |
COleConvertDialog::GetSelectionType | Gets the type of selection chosen. |
Name | Description |
---|---|
COleConvertDialog::m_cv | A structure that controls the behavior of the dialog box. |
Note
Application Wizard-generated container code uses this class.
For more information about OLE-specific dialog boxes, see the article Dialog Boxes in OLE.
COleConvertDialog
Header: afxodlgs.h
Constructs only a COleConvertDialog
object.
explicit COleConvertDialog (
COleClientItem* pItem,
DWORD dwFlags = CF_SELECTCONVERTTO,
CLSID* pClassID = NULL,
CWnd* pParentWnd = NULL);
pItem
Points to the item to be converted or activated.
dwFlags
Creation flag, which contains any number of the following values combined using the bitwise-or operator:
-
CF_SELECTCONVERTTO Specifies that the Convert To radio button will be selected initially when the dialog box is called. This is the default.
-
CF_SELECTACTIVATEAS Specifies that the Activate As radio button will be selected initially when the dialog box is called.
-
CF_SETCONVERTDEFAULT Specifies that the class whose CLSID is specified by the
clsidConvertDefault
member of them_cv
structure will be used as the default selection in the class list box when the Convert To radio button is selected. -
CF_SETACTIVATEDEFAULT Specifies that the class whose CLSID is specified by the
clsidActivateDefault
member of them_cv
structure will be used as the default selection in the class list box when the Activate As radio button is selected. -
CF_SHOWHELPBUTTON Specifies that the Help button will be displayed when the dialog box is called.
pClassID
Points to the CLSID of the item to be converted or activated. If NULL, the CLSID associated with pItem will be used.
pParentWnd
Points to the parent or owner window object (of type CWnd
) to which the dialog object belongs. If it is NULL, the parent window of the dialog box is set to the main application window.
To display the dialog box, call the DoModal function.
For more information, see CLSID Key and the OLEUICONVERT structure.
Call this function, after returning successfully from DoModal, either to convert or to activate an object of type COleClientItem.
BOOL DoConvert(COleClientItem* pItem);
pItem
Points to the item to be converted or activated. Cannot be NULL.
Nonzero if successful; otherwise 0.
The item is converted or activated according to the information selected by the user in the Convert dialog box.
Call this function to display the OLE Convert dialog box.
virtual INT_PTR DoModal();
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 OleUIConvert function in the Windows SDK.
If you want to initialize the various dialog box controls by setting members of the m_cv 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 that was input by the user into the dialog box.
Call this function to get the CLSID associated with the item the user selected in the Convert dialog box.
REFCLSID GetClassID() const;
The CLSID associated with the item that was selected in the Convert dialog box.
Call this function only after DoModal returns IDOK.
For more information, see CLSID Key in the Windows SDK.
Call this function to determine whether the user chose to display the selected item as an icon.
DVASPECT GetDrawAspect() const;
The method needed to render the object.
-
DVASPECT_CONTENT Returned if the Display As Icon check box was not checked.
-
DVASPECT_ICON Returned if the Display As Icon check box was checked.
Call this function only after DoModal returns IDOK.
For more information on drawing aspect, see the FORMATETC data structure in the Windows SDK.
Call this function to get a handle to the metafile that contains the iconic aspect of the selected item.
HGLOBAL GetIconicMetafile() const;
The handle to the metafile containing the iconic aspect of the selected item, if the Display As Icon check box was checked when the dialog was dismissed by choosing OK; otherwise NULL.
Call this function to determine the type of conversion selected in the Convert dialog box.
UINT GetSelectionType() const;
Type of selection made.
The return type values are specified by the Selection
enumeration type declared in the COleConvertDialog
class.
enum Selection {
noConversion,
convertItem,
activateAs
};
Brief descriptions of these values follow:
-
COleConvertDialog::noConversion
Returned if either the dialog box was canceled or the user selected no conversion. IfCOleConvertDialog::DoModal
returned IDOK, it is possible that the user selected a different icon than the one previously selected. -
COleConvertDialog::convertItem
Returned if the Convert To radio button was checked, the user selected a different item to convert to, andDoModal
returned IDOK. -
COleConvertDialog::activateAs
Returned if the Activate As radio button was checked, the user selected a different item to activate, andDoModal
returned IDOK.
Structure of type OLEUICONVERT used to control the behavior of the Convert dialog box.
OLEUICONVERT m_cv;
Members of this structure can be modified either directly or through member functions.
For more information, see the OLEUICONVERT structure in the Windows SDK.