Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate C# DLLImport declarations from a native dll

Tags:

Do you know a soft which automatically generates C# code (with [DllImport] attributes in .cs) from a native DLL in order to use this DLL in a C# code?

like image 626
Patrice Pezillier Avatar asked Sep 22 '10 16:09

Patrice Pezillier


People also ask

Can MATLAB run C Code?

In MATLAB®, you can extend your C and C++ code with a MEX function and call it like any MATLAB built-in function. That means you can use existing C and C++ code without rewriting your algorithms in MATLAB. MEX functions enable C and C++ code to create and modify MATLAB arrays in the MATLAB workspace.

What is C Code generation?

20-sim has a C-Code Generator which automatically converts a complete 20-sim model or submodel into C-Code. The application can be used to generate Matlab™/Simulink™ S-Functions, to generate Stand-Alone executables or to generate input/output functions for use in other C and C++ programs.

Can Simulink generate C Code?

Simulink® Coder™ generates standalone C and C++ code from Simulink models for deployment in a wide variety of applications. For a list of DSP System Toolbox™ features supported by Simulink Coder, see Blocks Supported for C Code Generation.


1 Answers

Checkout the P/Invoke Interop Assistant:

In marshalling, there are a bunch of attributes and rules. Understanding all those attributes and rules seem a bit daunting. In order to make developing work more efficient and easier on those attributes and the rules, P/Invoke Interop Assistant comes out. It is a toolkit that helps developers to efficiently convert from C to managed P/Invoke signatures or verse visa. This is conceptually similar to TlbImp for COM Interop which generates managed proxy entry points based on some formal description of the unmanaged side but it works for P/Invoke. The toolkit was first released on MSDN Magazine website in Jan, 2008.website in Jan, 2008.

like image 53
Darin Dimitrov Avatar answered Nov 11 '22 16:11

Darin Dimitrov