0

Can you provide a simple example or a link to a simple example.

user516983
  • 31
  • 1
  • 2

3 Answers3

1

It's not entirely clear from your question what you are trying to accomplish. There is no way to include the headers directly in any meaningful way in a C# project. C# doesn't use header files and compiles to IL.

Here is a link describing the various interop methods between managed and unmanaged code if you are seeking to consume e.g. an unmanaged library in C#. A search for PInvoke will turn up more references.

Edit: Better link to an SO post with more info

Community
  • 1
  • 1
flatline
  • 42,083
  • 4
  • 31
  • 38
0

You can't.

You need to manually port the structs to C# structs with attributes.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

There is no C# version of a macro from C++ or C. You'll need to make actual methods in C# to do the same operations.

The structs will need to be ported to C# struct types, as well. You cannot include a C or C++ header file into a C# program directly.

The methods that use the structs from the C or C++ DLL can be called from C#, if required, via Platform Invocation.

For details, see the MSDN Section on Consuming Unmanaged DLL Functions.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373