TVTDataObject.CanonicalI Method

Virtual Tree View

Helper method for setting data in the IDataObject.

Pascal
function CanonicalIUnknown(TestUnknown: IUnknown): IUnknown;
Description

In SetData the class can get a circular reference if the client calls GetData then calls SetData with the same StgMedium. Because the unkForRelease for the IDataObject can be marshalled it is necessary to get pointers that can be correctly compared. CanonicalIUknown uses COM object identity for this task. An explicit call to the IUnknown::QueryInterface method, requesting the IUnknown interface, will always return the same pointer. See the IDragSourceHelper article by Raymond Chen at MSDN.

Class
Links
What do you think about this topic? Send feedback!