all groups > dotnet interop > december 2007 >
You're in the

dotnet interop

group:

When to use Marshal.GetNativeVaraintForObject


When to use Marshal.GetNativeVaraintForObject Creativ
12/14/2007 5:57:27 AM
dotnet interop:
Hi, I notice that Marshal.GetNativeVaraintForObject is a way to create
a variant from object.

But DotNet can do marshalling from object to variant when an object is
used as a parameter.

Can anyone tell in which case I should use
RE: When to use Marshal.GetNativeVaraintForObject wpcmame
12/19/2007 3:01:00 AM
[quoted text, click to view]

You need it if you do custom marshalling.

I used it when I created a com-wrapper in c++/cli.

Unfortunatly there is no corresponding FreeNativeVariant so you will have
memory leaks unless you call some native function. (I think it is called
AddThis Social Bookmark Button