Hi,

I have a couple of questions concerning P/Invoke and calling unmanaged
code...

1. I have a native DLL that contains a function I am calling that that
returns a struct. One of the struct members is a double**, which I wish to
marshal as a double[][] in my C# .NET code. As I understand it, I will
have to implement a custom marshaler to make this translation. However, I
am struggling to find code examples that make the translation from native -
> managed code (I have found plenty marshaling in the other direction).
Has anyone got any good links or code samples showing how I might
implement this?

2. My native DLL also contains a couple of classes. Is there any way using
P/Invoke of calling methods on instances of those classes? My current
solution has been to declare some "wrapper" functions in my native DLL
that mirror the class methods but also accept a pointer to the specific
instance. These functions then call the actual method on the instance. Is
this a suitable solution, or can I get a handle to a native object through
P/Invoke and call the method directly?

Cheers,
Steven Mohapi-Banks

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to