By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

Marshaling complex structs from C# to managed C++ wrapper

P: n/a
I have written a managed C++ wrapper class around an old
C++ DLL that I have to use in my application. My problem
is I need to marshal a bunch of structures from C# to the
C++ class. These structuers contain mostly StringBuilder
objects, but some contain arrays of other structs that
themselves contain StringBuilder objects.

I have defined the stucts in the C++ header file as
typedef __gc StructName
{
StringBuilder *hmm;
....
}

Passing these back and forth works great. I make a change
to the structs in the C++ class, and it gets back to the
C# class just fine.

Now, how do I define a struct that contains an array of
other structs? Also, how do I instantiate it correctly
and how do I work with it on the C++ side? Can I do a
memcpy?

Any help would be greatly appreciated.

Regards,

Arthur Autenzio
ar*************@bostonstock.com

Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.