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

Call C# from C

P: n/a
Hi.
I know we can call native C or C++ function from C#.
I want to do reverse. I want to call C# function from C or C++.
What is the best way to do it.
It is just simple one time call of one of the function in C#.

Thank you in advance.
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Only way I know how is to wrap the C# function in COM and do it that way.
Seems like a lot of overhead for one function call though.

Chris
"C# beginner" <C# be******@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Hi.
I know we can call native C or C++ function from C#.
I want to do reverse. I want to call C# function from C or C++.
What is the best way to do it.
It is just simple one time call of one of the function in C#.

Thank you in advance.

Jul 21 '05 #2

P: n/a
CLR is supposed to support the JIT machanism turns out it really does not
care of the language as long as those codes will be able to compiled by CLR.
Actually the PE file's IL info is the souce codes in the viewpoint of CLR.

Turns out, you could easily make your codes CLR compatible by a complier
Option.

Of couse C++ could invoke C# method

--Paul
Hi.
I know we can call native C or C++ function from C#.
I want to do reverse. I want to call C# function from C or C++.
What is the best way to do it.
It is just simple one time call of one of the function in C#.

Thank you in advance.


Jul 21 '05 #3

P: n/a
I think he didn't talked about managed C++ but unmanaged plain C.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Paul" <pa*********@hotmail.com> schrieb im Newsbeitrag
news:OS**************@TK2MSFTNGP14.phx.gbl...
CLR is supposed to support the JIT machanism turns out it really does not
care of the language as long as those codes will be able to compiled by CLR. Actually the PE file's IL info is the souce codes in the viewpoint of CLR.

Turns out, you could easily make your codes CLR compatible by a complier
Option.

Of couse C++ could invoke C# method

--Paul
Hi.
I know we can call native C or C++ function from C#.
I want to do reverse. I want to call C# function from C or C++.
What is the best way to do it.
It is just simple one time call of one of the function in C#.

Thank you in advance.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.