Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Checks whether a data object has one of the formats that would allow it to become an embedded object through a call to either the OleCreateFromData or OleCreateStaticFromData function.
Syntax
HRESULT OleQueryCreateFromData(
[in] LPDATAOBJECT pSrcDataObject
);
Parameters
[in] pSrcDataObject
Pointer to the IDataObject interface on the data transfer object to be queried.
Return value
This function returns S_OK on success. Other possible values include the following.
| Return code | Description |
|---|---|
|
No formats are present that support either embedded- or static-object creation. |
|
Formats that support static-object creation are present. |
Remarks
When an application retrieves a data transfer object through a call to the OleGetClipboard function, the application should call OleQueryCreateFromData as part of the process of deciding to enable or disable the Edit/Paste or Edit/Paste Special... commands. It tests for the presence of the following formats in the data object:
- CF_EMBEDDEDOBJECT
- CF_EMBEDSOURCE
- cfFileName
- CF_METAFILEPICT
- CF_DIB
- CF_BITMAP
- CF_ENHMETAFILE
If OleQueryCreateFromData finds one of the CF_METAFILEPICT, CF_BITMAP, CF_DIB, or CF_ENHMETAFILE formats and none of the other formats, it returns OLE_S_STATIC, indicating that you should call the OleCreateStaticFromData function to create the embedded object.
If OleQueryCreateFromData finds one of the other formats (CF_EMBEDDEDOBJECT, CF_EMBEDSOURCE, or cfFileName), even in combination with the static formats, it returns S_OK, indicating that you should call the OleCreateFromData function to create the embedded object.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 2000 Professional [desktop apps only] |
| Minimum supported server | Windows 2000 Server [desktop apps only] |
| Target Platform | Windows |
| Header | ole2.h |
| Library | Ole32.lib |
| DLL | Ole32.dll |
| API set | ext-ms-win-com-ole32-l1-1-3 (introduced in Windows 10, version 10.0.10240) |