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
 

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

Back
Top