110,535
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
int __stdcall Add(int numa, int numb)
{
return (numa + numb);
}
int __stdcall Sub(int numa, int numb)
{
return (numa - numb);
}
---def
LIBRARY "MyDll"
EXPORTS
Add @ 1
Sub @ 2
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace DotNetTest
{
class CMyDll
{
[DllImport("MyDll", EntryPoint = "Add", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
public static extern int Add(int a,int b);
}
}