I'm trying to do the following trick:
- I have
IDataObject*
to be set into the clipboard, so I'm usingOleSetClipboard()
to set it into the clipboard. - I have another
CLIPFORMAT
I want to add to the clipboard, but I can't do it withOleSetClipboard()
because theIDataObject*
I receive does not implementSetData()
method. So, to overcome this limitation IOpenClipboard()
withGetClipboardOwner()
, this way, I canSetClipboardData()
to the clipboard withoutEmptyClipboard()
first.
Now, it all works well, but what happens is that OleGetClipboard()
does not return the data I placed in the clipboard using SetClipboardData()
, but I can using GetClipboardData()
.
I can imagine why this happens (It just returns the IDataObject*
), so I tried to OleFlushClipboard()
to delete the IDataObject*
, and OleGetClipboard()
again to let the OS rebuild a new IDataObject*
, and it still didn't contain the CLIPFORMAT
added by SetClipboardData()
.
Does anyone have any idea how to overcome this issue? or a different trick? or even explain why it works this way? Thanks