dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Calling between C and C# IL code: how?


From: David Jung
Subject: [DotGNU]Calling between C and C# IL code: how?
Date: Sun, 13 Apr 2003 16:23:15 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

I would like to call C functions from C# and C# from C.
I think I can figure out C->C# using __invoke__, but can't figure
out how to do C#->C.
I don't need to call out to native C functions using P/Invoke, but
just to C functions compiled via cscc into IL.
The c_users_guide.html just has TODO written at the appropriate place,
so wasn't much help.
I used ildasm to look at the IL output for the C functions, and
it contains the line:

.class public auto sealed ansi $Module$ extends [mscorlib]System.Object

in which the C functions are declared as static methods. However, I can't use $Module$ as a valid namespace in C#.

Any clues anyone?

Thanks.
-David.

PS: Is anone working on a managed C++ compiler for .GNU? (either compatible or incompatible with MS's version - don't care)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]