Freigeben über


CRichEditView::QueryAcceptData

virtual HRESULT QueryAcceptData(LPDATAOBJECT lpdataobj**, CLIPFORMAT FAR *** lpcfFormat**, DWORD** dwReco**, BOOL** bReally**, HGLOBAL** hMetaFile );

Return Value

An HRESULT value reporting the success of the operation.

Parameters

lpdataobj

Pointer to the to query.

lpcfFormat

Pointer to the acceptable data format.

dwReco

Not used.

bReally

Indicates if the paste operation should continue or not.

hMetaFile

A handle to the metafile used for drawing the item’s icon.

Remarks

Called by the framework to paste an object into the rich edit. Override this function to handle different organization of COM items in your derived document class. This is an advanced overridable.

For more information on HRESULT and IDataObject, see and , respectively, in the Platform SDK.

Example

// From the WordPad sample, wordpvw.cpp
HRESULT CWordPadView::QueryAcceptData(LPDATAOBJECT lpdataobj,
   CLIPFORMAT* lpcfFormat, DWORD reco, BOOL bReally,
   HGLOBAL hMetaPict)
{
   if (bReally && *lpcfFormat == 0 && (m_nPasteType == 0))
   {
      COleDataObject dataobj;
      dataobj.Attach(lpdataobj, FALSE);
      if (!dataobj.IsDataAvailable(cfRTO)) // native avail, let
                                           // richedit do as it wants
      {
         if (dataobj.IsDataAvailable(cfEmbeddedObject))
         {
            if (PasteNative(lpdataobj)) // See WordPad for info
                                        // on PasteNative
               return S_FALSE;
         }
      }
   }
   return CRichEditView::QueryAcceptData(lpdataobj, lpcfFormat, reco,
      bReally, hMetaPict);
}

CRichEditView OverviewClass MembersHierarchy Chart