Compartir a través de


COleDataObject::IsDataAvailable

Call this function to determine if a particular format is available for retrieving data from the OLE item.

BOOL IsDataAvailable(
   CLIPFORMAT cfFormat,
   LPFORMATETC lpFormatEtc = NULL 
);

Parameters

  • cfFormat
    The Clipboard data format to be used in the structure pointed to by lpFormatEtc. This parameter can be one of the predefined Clipboard formats or the value returned by the native Windows RegisterClipboardFormat function.

  • lpFormatEtc
    Points to a FORMATETC structure describing the format desired. Provide a value for this parameter only if you want to specify additional format information beyond the Clipboard format specified by cfFormat. If it is NULL, the default values are used for the other fields in the FORMATETC structure.

Return Value

Nonzero if data is available in the specified format; otherwise 0.

Remarks

This function is useful before calling GetData, GetFileData, or GetGlobalData.

For more information, see IDataObject::QueryGetData and FORMATETC in the Windows SDK.

For more information, see RegisterClipboardFormat in the Windows SDK.

Example

See the example for CRichEditView::QueryAcceptData.

Requirements

Header: afxole.h

See Also

Reference

COleDataObject Class

Hierarchy Chart

COleDataObject::BeginEnumFormats

COleDataObject::GetData

COleDataObject::GetFileData

COleDataObject::GetGlobalData

COleDataObject::GetNextFormat

Other Resources

COleDataObject Members