Using “C” dll in C# [duplicate]

2019-08-02 14:29发布

Possible Duplicate:
How do I call unmanaged C/C++ code from a C# ASP.NET webpage

I have a dll file that is written in "C" language, i want to use it in C#. How can i do that?

标签: c# c dll
2条回答
劳资没心,怎么记你
2楼-- · 2019-08-02 15:01

You can do a DllImport in your C# code and then use PInvoke.

For your custom dll you can try this example answer on SO.

This a good website for reference for using windows dlls

查看更多
一纸荒年 Trace。
3楼-- · 2019-08-02 15:02

You can use PInvoke

Platform Invocation Services (PInvoke) allows managed code to call unmanaged functions that are implemented in a DLL.

Here is a great tutorial by the NAG (Numerical Algorithms Group) group

查看更多
登录 后发表回答