473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Call C# from C

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
3 4052
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
13
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
12
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.