Using C Classes with C# in Visual Studio

  • Thread starter Thread starter Tom Bolton via .NET 247
  • Start date Start date
T

Tom Bolton via .NET 247

Once, a long time ago in a galaxy far far away, I used to write C (very small-time, but I did). Anyway, now I've been learning C# in Visual Studio, and I need to access a C API from C#. Can this be done? How?

I've searched the Archives, but it's almost impossible to do a search that comes up with anything like the right results, so I'm just posting the question.

Any help would be greatly appreciated.
 
If your C API has been exported to a dll, you could use PInvoke to get
access to it. Another option would be make a managed wrapper of your module
using C++ managed extensions (MC++) and then use this in any .net module.

--
Ajay Kalra [MVP - VC++]
(e-mail address removed)


Tom Bolton via .NET 247 said:
Once, a long time ago in a galaxy far far away, I used to write C (very
small-time, but I did). Anyway, now I've been learning C# in Visual Studio,
and I need to access a C API from C#. Can this be done? How?
I've searched the Archives, but it's almost impossible to do a search that
comes up with anything like the right results, so I'm just posting the
question.
 
Back
Top