views:

17

answers:

1

WI have a windows shell extension which adds menu items to the printer menu when the printer is right-clicked. The code works fine in Windows 2000, XP, Vista, but in Windows 7 the call to GetData() fails with DV_E_FORMATETC. I've found various threads regarding this but they all appear to be VB/asp related. The FORMATETC and STGMEDIUM structures are initialised as follows

STGMEDIUM medium = {TYMED_HGLOBAL, {0}, 0};
FORMATETC fmte  = {(unsigned short)RegisterClipboardFormat(CFSTR_PRINTERGROUP), 
                   NULL, 
                   DVASPECT_CONTENT, 
                   -1, 
                   TYMED_HGLOBAL};
<snip>
hrc = pDataObj->GetData(&fmte, &medium);
if (FAILED(hrc))
{
   hrc is DV_E_FORMATETC