HighTechTalks DotNet Forums  

When to use Marshal.GetNativeVaraintForObject

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss When to use Marshal.GetNativeVaraintForObject in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Creativ
 
Posts: n/a

Default When to use Marshal.GetNativeVaraintForObject - 12-14-2007 , 07:57 AM






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
Marshal.GetNativeVaraintForObject ?

Reply With Quote
  #2  
Old   
wpcmame
 
Posts: n/a

Default RE: When to use Marshal.GetNativeVaraintForObject - 12-19-2007 , 05:01 AM






Quote:
But DotNet can do marshalling from object to variant when an object is
used as a parameter.
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
VariantClear in ole.dll)


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.