Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Explorer throws an exception when closed if my dataobject is copied in clipboard !

13 views
Skip to first unread message

Assem

unread,
May 2, 2007, 5:31:11 AM5/2/07
to
Hi all,
I supported a simple private clipboard in addition to
CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS format in my IDataObject
implementation class of my namespace extension.

When i do a copy then close the explorer window that i made a copy
from, it calls the GetData indicating a need to my private format, So
the method set the Global memory for the private structure, and
immediately after return, explorer throws access violation exception.

I think the Explorer calls OleFlushClipboard (). when i close that
window .

How can i know when to Empty the Clipboard before the Explorer calls
CDataObjectImpl::GetData ?

Thanks,
Assem

Michael Phillips, Jr.

unread,
May 3, 2007, 10:22:33 AM5/3/07
to
> How can i know when to Empty the Clipboard before the Explorer calls
> CDataObjectImpl::GetData ?

In a "Copy" operation, the very first thing that you do is call
OleSetClipboard(NULL). This empties the clipboard.

When you construct an IDataObject object from the pidl and place it on the
clipboard by OleSetClipboard, the clipboard owns the object and manages its
lifespan.


0 new messages