I have a program which is able to exchange data with MS Office applications, via the clipboard.
This works fine in Office 2007 and Windows Vista/XP, but fails with Office 2010/Windows 7
IDataObject *d = NULL;
HRESULT hr = ::OleGetClipboard(&d);
if (hr == S_OK)
{
FORMATETC formatEtc;
formatEtc.cfFormat = ::RegisterClipboardFormat("Native");
formatEtc.ptd = NULL;
formatEtc.dwAspect = DVASPECT_CONTENT;
formatEtc.lindex = -1;
STGMEDIUM stgMedium;
hr = d->QueryGetData(&formatEtc);
Following this call, I am returned an error - 0x8004006a Invalid clipboard format
I have tried searching the web, but haven't found any relevant information. Any advice/suggestions would be gratefully received.
Thanks.