include a c file in .net

  • Thread starter Thread starter Sara
  • Start date Start date
S

Sara

I have an old c file taht does what I need. Is there a way
to use that file and call its functions in .net??
 
Sara,

Yes, you can use the existing source with your .NET applications. I see two
possible choices:

#1 Turn your C functions into a classic DLL, and use platform invoke:

Consuming Unmanaged DLL Functions
http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp

#2 Turn your C functions into a .NET DLL, via C++ managed extensions:

Upgrade to Managed Extensions for C++
http://msdn.microsoft.com/library/d...tml/vcconupgradingtomanagedextensionsforc.asp

Regards,

Gabriele
 
Back
Top