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

Calling a managed __gc class from a mixed mode dll, please help!

P: n/a
I have a mixed mode dll with a garbage collected interface. The interface is
garbage collected because my derrived class has managed member variables. I
am trying to return a pointer to my interface using GetProcAddress and
calling an exported function which instantiates and returns my derrived
class. While this works for the native portion(also interfaces) of my DLL,
this fails with my managed class. The exception I receive is "Can not
marshal return value: The type definition of this type has no layout
information."

P.S. Sorry for the begging in the subject I just can't seem to find an answer.

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello,
I have a mixed mode dll with a garbage collected interface. The interface is garbage collected because my derrived class has managed member variables.


You can try to enwrap these managed members with gcroot<ManagedType*>
template.
While this allows to keep managed references, class remains native.
--
Vladimir Nesterovsky
e-mail: vl******@nesterovsky-bros.com
home: www.nesterovsky-bros.com
Nov 17 '05 #2

P: n/a
Just wanted to say thanks! This solution worked perfectly!
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.