0,概述
查了网上的资料,目前知道两种情况,一种是用C++/CLI(通用语言接口),另一种则是使用COM组建。
1,C++/CLI(通用语言接口)
下面代码参照:http://blog.csdn.net/qingzai_/article/details/53391662
1.1,C#代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace TestDLL
{
public class DLLExport
{
public int GetMax(int a, int b)
{
return (b > a ? b : a);
}
public int GetMin(int a, int b)
{
return (b > a ? a : b);
}
}
}
有两个方法,一个是取最大值,一个是取最小值。
编译生成TestDLL.dll。
1.2 C++代码
#include "stdafx.h"
#include <Windows.h>
#using "..\\TestDLL\\bin\\Debug\\TestDLL.dll"
using namespace
2621




被折叠的 条评论
为什么被折叠?



