Export (0) Print
Expand All

OleUIPasteSpecial function

Invokes the standard Paste Special dialog box, allowing the user to select the format of the clipboard object to be pasted or paste-linked.

Syntax


UINT OleUIPasteSpecial(
  _In_  LPOLEUIPASTESPECIAL lpPS
);

Parameters

lpPS [in]

A pointer to an OLEUIPASTESPECIAL structure.

Return value

Standard Success/Error Definitions

Return codeDescription
OLEUI_FALSE

Unknown failure (unused).

OLEUI_OK

The user pressed the OK button.

OLEUI_SUCCESS

No error, same as OLEUI_OK.

OLEUI_CANCEL

The user pressed the Cancel button.

 

Standard Field Validation Errors

Return codeDescription
OLEUI_ERR_STANDARDMIN

Errors common to all dialog boxes lie in the range OLEUI_ERR_STANDARDMIN to OLEUI_ERR_STANDARDMAX. This value allows the application to test for standard messages in order to display error messages to the user.

OLEUI_ERR_STRUCTURENULL

The pointer to an OLEUIXXX structure passed into the function was NULL.

OLEUI_ERR_STRUCTUREINVALID

Insufficient permissions for read or write access to an OLEUIXXX structure.

OLEUI_ERR_CBSTRUCTINCORRECT

The cbstruct value is incorrect.

OLEUI_ERR_HWNDOWNERINVALID

The hWndOwner value is invalid.

OLEUI_ERR_LPSZCAPTIONINVALID

The lpszCaption value is invalid.

OLEUI_ERR_LPFNHOOKINVALID

The lpfnHook value is invalid.

OLEUI_ERR_HINSTANCEINVALID

The hInstance value is invalid.

OLEUI_ERR_LPSZTEMPLATEINVALID

The lpszTemplate value is invalid.

OLEUI_ERR_HRESOURCEINVALID

The hResource value is invalid.

 

Initialization Errors

Return codeDescription
OLEUI_ERR_FINDTEMPLATEFAILURE

Unable to find the dialog box template.

OLEUI_ERR_LOADTEMPLATEFAILURE

Unable to load the dialog box template.

OLEUI_ERR_DIALOGFAILURE

Dialog box initialization failed.

OLEUI_ERR_LOCALMEMALLOC

A call to LocalAlloc or the standard IMalloc allocator failed.

OLEUI_ERR_GLOBALMEMALLOC

A call to GlobalAlloc or the standard IMalloc allocator failed.

OLEUI_ERR_LOADSTRING

Unable to call LoadString to get localized resources from the library.

OLEUI_ERR_OLEMEMALLOC

A call to the standard IMalloc allocator failed.

 

Function Specific Errors

Return codeDescription
OLEUI_ERR_STANDARDMAX

Errors common to all dialog boxes lie in the range OLEUI_ERR_STANDARDMIN to OLEUI_ERR_STANDARDMAX. This value allows the application to test for standard messages in order to display error messages to the user.

OLEUI_IOERR_SRCDATAOBJECTINVALID

The lpSrcDataObject member of OLEUIPASTESPECIAL is invalid.

OLEUI_IOERR_ARRPASTEENTRIESINVALID

The arrPasteEntries member of OLEUIPASTESPECIAL is invalid.

OLEUI_IOERR_ARRLINKTYPESINVALID

The arrLinkTypes member of OLEUIPASTESPECIAL is invalid.

OLEUI_PSERR_CLIPBOARDCHANGED

The clipboard contents changed while the dialog box was displayed.

OLEUI_PSERR_GETCLIPBOAARDFAILED

The lpSrcDataObj member is incorrect.

 

Remarks

The design of the Paste Special dialog box assumes that if you are willing to permit a user to link to an object, you are also willing to permit the user to embed that object. For this reason, if any of the OLEUIPASTE_LINKTYPE flags associated with the OLEUIPASTEFLAG enumeration are set, then the OLEUIPASTE_PASTE flag must also be set in order for the data formats to appear in the Paste Special dialog box.

The text displayed in the Source field of the standard Paste Special dialog box, which is implemented in Oledlg32.dll, is the null-terminated string whose offset in bytes is specified in the dwSrcofCopy member of the OBJECTDESCRIPTOR structure for the object to be pasted. If an OBJECTDESCRIPTOR structure is not available for this object, the dialog box displays whatever text may be associated with CF_LINKSOURCEDESCRIPTOR. If neither structure is available, the dialog box looks for CF_FILENAME. If CF_FILENAME is not found, the dialog box displays the string "Unknown Source".

To free an HMETAFILEPICT returned from the Insert Object or Paste Special dialog box, delete the attached metafile on the handle, as follows.

 
void FreeHmetafilepict(HMETAFILEPICT hmfp) 
{ 
    if (hmfp != NULL) 
        { 
        LPMETAFILEPICT pmfp = GlobalLock(hmfp); 
 
        DeleteMetaFile(pmfp->hMF); 
        GlobalUnlock(hmfp); 
        GlobalFree(hmfp); 
        } 
    else
        {
        // Handle null pointers here.
        exit(0);
        }
}  // FreeHmetafilepict 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleDlg.h

Library

OleDlg.lib

DLL

OleDlg.dll

Unicode and ANSI names

OleUIPasteSpecialW (Unicode) and OleUIPasteSpecialA (ANSI)

See also

OLEUIPASTEFLAG

 

 

Community Additions

ADD
Show:
© 2014 Microsoft