Groups | Blog | Home
all groups > dotnet interop > july 2007 >

dotnet interop : Marshalling a complext structure


Asif Khan
7/10/2007 6:35:09 PM
Hi All,

I am working with clipboard. It stores data pointed to by using a void
pointer. I have a managed object of a complext structrue containing native
data (e.g. int, long) as well as objects of my own class and arrays of
objects, pointers to objects etc. How to marshal that structure to unmanaged
memory so I can store it in clipboard as binary object. Is there any other
way to do this.

Thanks
Asif

Michael Phillips, Jr.
7/11/2007 7:39:18 PM
Create an unmanaged IStream interface backed by a block of global unmanaged
memory(e.g, CreateStreamOnHGlobal).

Use the IStream methods to copy your complex structures from managed memory
and then place the IStream interface pointer on the clipboard via the
IDataObject interface.

[quoted text, click to view]

AddThis Social Bookmark Button