Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

C code from C#

Hello there,

We have a file management application written in C#. I've been asked to some extra features to our application - and these features mostly need some standard algorithms to be implemented. We have (due to an older development) code that implements all these algorithms in 'C' - and it's pretty well done (has a good APUI interface). I don't see a point in re-implementing the whole thing in C# (quite a lot of work), instead I'd like to just re-use that C code in some form and get  my work done.

I'm not familiar with this specific area of interfacing - can people suggest the best way to do it? an examples/pointers appreciated.

Sarah
Monday, June 27, 2005

If your code is compiled to a DLL you can use DllImport to call the exported methods.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicesdllimportattributeclasstopic.asp

Jeff Mastry
Monday, June 27, 2005

*  Recent Topics

*  Fog Creek Home