111,097
社区成员




namespace test_CS
{
public class test
{
[DllImport("mydll.dll", EntryPoint = "?get@@YAHXZ")]
public static extern int get();
public void show()
{
Console.WriteLine(get().ToString());
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
test t1 = new test();
test t2 = new test();
t1.show();
t2.show();
}
}
}
#include "stdafx.h"
static int number = 0;
__declspec(dllexport) int get ()
{
number++;
return number;
}