Re: array of structures to unmanaged memory
- From: "DLI" <equisoft@xxxxxxxxxxxx>
- Date: Sat, 16 Feb 2008 15:56:11 -0600
Thank you for the reply.
I am trying to port some VB6 code that does work properly with this dll
The VB6 code passed in the array of Types ByRef
I tried ByVal and I get a stack overflow error
In regards to this posting, I did google this thread:
http://www.dotnet247.com/247reference/msgs/43/215864.aspx
The following quote is from that very long thread
<<<<
The marshaller cannot handle "embedded arrays of structures" and "variable
length structs". It can only handle embedded arrays of blittable types(int,
char etc) - as I illustrated in a previous post.
If you really want to use C# to pass such managed structures to unmanaged
code, you'll need to help the marshaller by passing as argument to the API,
a pointer to a buffer, that contains a copy of the managed struct fields you
marshalled using the Marshal.WriteXX methods. On return you need to copy the
buffer contents back to the managed structure using the Marshal.ReadXX
I am just surprised that I can't find a syntax in DotNet to marshal an array
of structures
the same way VB6 marshalled an array of types.
The un-managed function is buried in a Fortran dll that I do not have the
source for.
Am I missing something simple here?
.
- Follow-Ups:
- Re: array of structures to unmanaged memory
- From: Jeroen Mostert
- Re: array of structures to unmanaged memory
- References:
- array of structures to unmanaged memory
- From: DLI
- Re: array of structures to unmanaged memory
- From: Jeroen Mostert
- array of structures to unmanaged memory
- Prev by Date: Re: Creating a Web Site and publishing it
- Next by Date: Re: Creating a Web Site and publishing it
- Previous by thread: Re: array of structures to unmanaged memory
- Next by thread: Re: array of structures to unmanaged memory
- Index(es):
Relevant Pages
|