C#调用C++dll
生活随笔
收集整理的這篇文章主要介紹了
C#调用C++dll
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1.添加命名空間 using System.Runtime.InteropServices;
2.dll的添加和函數(shù)的聲明(注意一定要放在函數(shù)(方法)的外面)
[DllImport("User32.dll")] public static extern int MessageBox(int h, string m, string c, int type);3.使用,在函數(shù)內(nèi)添加
MessageBox(0, "我正在調(diào)用c++dll", "C#",0x30); ? ?
4.結(jié)果:
轉(zhuǎn)載于:https://www.cnblogs.com/lwngreat/p/4103397.html
總結(jié)
以上是生活随笔為你收集整理的C#调用C++dll的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sql存储过程的创建
- 下一篇: 移动Web开发实践——解决positio