469,581 Members | 1,960 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,581 developers. It's quick & easy.

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

hello

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

Thank you
Nov 15 '05 #1
4 4725
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Andreas Ntalakas" <a_********@hotmail.com> wrote in message
news:CB**********************************@microsof t.com...
hello,

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

Nov 15 '05 #2
Yes, but you need to write Managed C++ wrapper for the unmanaged C++ to
call.

"Andreas Ntalakas" <a_********@hotmail.com> wrote in message
news:CB**********************************@microsof t.com...
hello,

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

Nov 15 '05 #3
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]
- mv*@spam.guard.caspershouse.com

"Sanjay Vyas" <sanjayvyas@_hotmail.com> wrote in message
news:uK**************@TK2MSFTNGP10.phx.gbl...
Yes, but you need to write Managed C++ wrapper for the unmanaged C++ to
call.

"Andreas Ntalakas" <a_********@hotmail.com> wrote in message
news:CB**********************************@microsof t.com...
hello,

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

C++ code?

Thank you


Nov 15 '05 #4
What I meant was
unmanaged C++ --> managed C++ --> managed C# :)

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uk*************@TK2MSFTNGP12.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Sanjay Vyas" <sanjayvyas@_hotmail.com> wrote in message
news:uK**************@TK2MSFTNGP10.phx.gbl...
Yes, but you need to write Managed C++ wrapper for the unmanaged C++ to
call.

"Andreas Ntalakas" <a_********@hotmail.com> wrote in message
news:CB**********************************@microsof t.com...
hello,

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

Thank you



Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Gnanaprakash Rathinam | last post: by
1 post views Thread by sunil s via DotNetMonster.com | last post: by
6 posts views Thread by Mark Jerde | last post: by
10 posts views Thread by =?Utf-8?B?UmF2aSBTaGFua2Fy?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.