COleChangeSourceDialog Class
Used for the OLE Change Source dialog box.
class COleChangeSourceDialog : public COleDialog
Name | Description |
---|---|
COleChangeSourceDialog::COleChangeSourceDialog | Constructs a COleChangeSourceDialog object. |
Name | Description |
---|---|
COleChangeSourceDialog::DoModal | Displays the OLE Change Source dialog box. |
COleChangeSourceDialog::GetDisplayName | Gets the complete source display name. |
COleChangeSourceDialog::GetFileName | Gets the filename from the source name. |
COleChangeSourceDialog::GetFromPrefix | Gets the prefix of the previous source. |
COleChangeSourceDialog::GetItemName | Gets the item name from the source name. |
COleChangeSourceDialog::GetToPrefix | Gets the prefix of the new source |
COleChangeSourceDialog::IsValidSource | Indicates if the source is valid. |
Name | Description |
---|---|
COleChangeSourceDialog::m_cs | A structure that controls the behavior of the dialog box. |
Create an object of class COleChangeSourceDialog
when you want to call this dialog box. After a COleChangeSourceDialog
object has been constructed, you can use the m_cs structure to initialize the values or states of controls in the dialog box. The m_cs
structure is of type OLEUICHANGESOURCE. For more information about using this dialog class, see the DoModal member function.
For more information, see the OLEUICHANGESOURCE structure in Windows SDK.
For more information about OLE-specific dialog boxes, see the article Dialog Boxes in OLE.
COleChangeSourceDialog
Header: afxodlgs.h
This function constructs a COleChangeSourceDialog
object.
explicit COleChangeSourceDialog(
COleClientItem* pItem,
CWnd* pParentWnd = NULL);
pItem
Pointer to the linked COleClientItem whose source is to be updated.
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 will be set to the main application window.
To display the dialog box, call the DoModal function.
For more information, see the OLEUICHANGESOURCE structure and OleUIChangeSource function in Windows SDK.
Call this function to display the OLE Change Source 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 OleUIChangeSource function in Windows SDK.
If you want to initialize the various dialog box controls by setting members of the m_cs structure, you should do this before calling DoModal
, but after the dialog object is constructed.
If DoModal
returns IDOK, you can call member functions to retrieve user-entered settings or information from the dialog box. The following list names typical query functions:
Call this function to retrieve the complete display name for the linked client item.
CString GetDisplayName();
The complete source display name (moniker) for the COleClientItem specified in the constructor.
Call this function to retrieve the file moniker portion of the display name for the linked client item.
CString GetFileName();
The file moniker portion of the source display name for the COleClientItem specified in the constructor.
The file moniker together with the item moniker gives the complete display name.
Call this function to get the previous prefix string for the source.
CString GetFromPrefix();
The previous prefix string of the source.
Call this function only after DoModal returns IDOK.
This value comes directly from the lpszFrom
member of the OLEUICHANGESOURCE structure.
For more information, see the OLEUICHANGESOURCE structure in Windows SDK.
Call this function to retrieve the item moniker portion of the display name for the linked client item.
CString GetItemName();
The item moniker portion of the source display name for the COleClientItem specified in the constructor.
The file moniker together with the item moniker gives the complete display name.
Call this function to get the new prefix string for the source.
CString GetToPrefix();
The new prefix string of the source.
Call this function only after DoModal returns IDOK.
This value comes directly from the lpszTo
member of the OLEUICHANGESOURCE structure.
For more information, see the OLEUICHANGESOURCE structure in Windows SDK.
This data member is a structure of type OLEUICHANGESOURCE.
OLEUICHANGESOURCE m_cs;
OLEUICHANGESOURCE
is used to control the behavior of the OLE Change Source dialog box. Members of this structure can be modified directly.
For more information, see the OLEUICHANGESOURCE structure in Windows SDK.
Call this function to determine if the new source is valid.
BOOL IsValidSource();
Nonzero if the new source is valid, otherwise 0.
Call this function only after DoModal returns IDOK.
For more information, see the OLEUICHANGESOURCE structure in Windows SDK.