开发者

Error DV_E_FORMATETC when asking for CFSTR_PRINTERGROUP - Windows 7

开发者 https://www.devze.com 2023-01-04 18:55 出处:网络
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() fa

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 


I found Link which seems to answer this.

0

精彩评论

暂无评论...
验证码 换一张
取 消