C# DLL and C

G

GTi

I have a old C project that is to big to be converted to C# at once.
So we are tinking of doing it step by step.

Is it possible to execute a C# DLL function from C ?

It is possible to execute a C function in C# but what about the other way?
 
R

Richard Blewett [DevelopMentor]

From C you will have to use COM interop (CoCreateInstance and friends) to call the C# code (lookup tlbexp.exe and regasm.exe)

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I have a old C project that is to big to be converted to C# at once.
So we are tinking of doing it step by step.

Is it possible to execute a C# DLL function from C ?

It is possible to execute a C function in C# but what about the other way?
 
G

GTi

Hmmm, never had a affair with CoCreateInstance with hers friends before....
Tanks Richard, will check her up.
 
F

Frans Bouma [C# MVP]

GTi said:
I have a old C project that is to big to be converted to C# at once.
So we are tinking of doing it step by step.

Is it possible to execute a C# DLL function from C ?

Via COM you can. Generate a typelib from your C# dll and you can then
use it as a dll with COM components in C. Though I wouldn't go there,
it's far from optimal.

FB

--
 

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