[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Marshalling a complext structure

Asif Khan

7/10/2007 1:35:00 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


1 Answer

Michael Phillips, Jr.

7/11/2007 11:39:00 PM

0

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.

"Asif Khan" <asif.khan@bentley.com> wrote in message
news:ORnVpavwHHA.3588@TK2MSFTNGP06.phx.gbl...
> 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
>