Skip to main content

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this. If the API uses any kind of objects this will probably be an painful approach.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.This looks like a nice guide on how to do this.. An advantage of this is that it allows you to write wrappers around objects to provide a object oriented API.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this. If the API uses any kind of objects this will probably be an painful approach.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.. An advantage of this is that it allows you to write wrappers around objects to provide a object oriented API.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this. If the API uses any kind of objects this will probably be an painful approach.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.. An advantage of this is that it allows you to write wrappers around objects to provide a object oriented API.
added 190 characters in body
Source Link
JonasH
  • 6.3k
  • 23
  • 21

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this. If the API uses any kind of objects this will probably be an painful approach.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.. An advantage of this is that it allows you to write wrappers around objects to provide a object oriented API.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this. If the API uses any kind of objects this will probably be an painful approach.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.. An advantage of this is that it allows you to write wrappers around objects to provide a object oriented API.
added 46 characters in body
Source Link
JonasH
  • 6.3k
  • 23
  • 21

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. So perhapsIf the API does not applicable inexpose c-style (i.e. extern C) functions you will need a wrapper that does this case.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. So perhaps not applicable in this case.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.

There are various ways to call native code from c#

  1. P/Invoke - allows c-style method calls directly from c# code. If the API does not expose c-style (i.e. extern C) functions you will need a wrapper that does this.
  2. C++/CLI - This allows you to use .Net types in a c++ project. So you would create a wrapper c++ project that interfaces with the opentrack API, and is called from your regular c# code. This looks like a nice guide on how to do this.
Source Link
JonasH
  • 6.3k
  • 23
  • 21
Loading