Call functions in a C# .dll from unmanaged C++

G

Guest

hello

is it possible to call functions implemented in a C# .dll from unmanaged C++ code

Thank you
 
N

Nicholas Paldino [.NET/C# MVP]

Andreas,

The only way you are going to be able to do this is to either mix your
C++ code with managed C++ code (have a mixed mode application), or to export
your .NET types as COM types, and then access them in your C++ application.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

Sanjay,

This isn't necessarily correct. The C# code is already managed, so you
won't need a managed C++ wrapper around the managed assembly that the OP
wants to use.
 
S

Sanjay Vyas

What I meant was
unmanaged C++ --> managed C++ --> managed C# :)

Nicholas Paldino said:
Sanjay,

This isn't necessarily correct. The C# code is already managed, so you
won't need a managed C++ wrapper around the managed assembly that the OP
wants to use.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Sanjay Vyas said:
Yes, but you need to write Managed C++ wrapper for the unmanaged C++ to
call.

unmanaged
C++ code?
 

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