We have had problems in the past with VB6 passing arrays of UDT to
Fortran. In VB6, the order that the UDT elements are added to the
stack cannot be guaranteed.
If we populate an array of structures and pass it to a com dll such as
the Fortran DLL, will we face the same issues with structure elements
being added to the stack?
In other words, does the CLR handle structure elements better than VB6
handled UDT elements in adding them to the stack?
TIA
The CLR will normally optimise a Structure at compile time and therefore
you would experience similar problems. However, that being said, you can
specify an Attribute to the Structure to turn this feature Off. See the
<StructLayout()> attribute in System.Runtime.InteropServices for
details.
--
Andrew D. Newbould E-Mail: NO-usen...@zadsoft.com
ZAD Software Systems Web : www.zadsoft.com
Thank you very much for the response. I will check it out.
(;()}
OK, here is another issue. The explicit option LayoutKind.explicit
works for most of our structures, but we have a couple that include an
array of doubles as one of the members of the structures that can have
a variable number of elements that follow an array of doubles that has
a fixed number of elements.
Should I just use sequential for these structures without specifying
any offsets, or can I use sequential and still specify the offsets for
the first few members of the structure?
TIA