本人是用易語言起步的,起初是為了興趣,后來由于易語言被殺軟誤殺嚴重,連空白程序都殺,后來轉到了學C#,隨著學習的深入,接觸越來越復雜的東西之后,發現有些功能沒有用易語言來寫方便,所以就想到用C#來調用易語言寫的DLL,就和一般的Dll調用一樣,沒什么技術含量。
易語言中新建個Dll文件
C#中和一般的DLL一樣調用
<p>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices;</p><p> </p><p>namespace e_dll { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("msg.dll")] public static extern void msgbox(string text,string title); private void button1_Click(object sender, EventArgs e) { msgbox("成功調用易語言dll!", "測試"); } } } </p>
感謝大家對VEVB武林網的支持,測試一下以上代碼內容吧。
新聞熱點
疑難解答