C# Structures, Constructors and Unmanaged Code

G

Guest

I have created a C# class library to interface to unmanaged code in a DLL.
Everything is working fine. In some cases, I have structures passed by value
or reference (out or ref). In some cases, there are structures within
structures.
These structures were defined by the designer of the DLL. What I'm wondering
is, can I add a constructor in C# to the structure definition, without
screwing up the interface between managed and unmanaged code?
Thanks in advance for the help,
Dennis
 
M

Mattias Sjögren

What I'm wondering
is, can I add a constructor in C# to the structure definition, without
screwing up the interface between managed and unmanaged code?

Yes, you can add any method you want, including constructors.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top