查过一些资料
基本上可以调用函数象:
[DllImport ("ex.dll")]
public extern static int Set(int i);但是为什么运行的时候提示无法找到ex.dll中set的入口??还有就是如果我想调用ex.dll文件中的类应该怎么写?ex.dll文件包括:
Hello.h:class Hello{
private:
int _i;
public:
void Set(int i);
int Get();
};Hello.cpp:#include ".\hello.h"
void Hello::Set(int i){
this->_i = i;
}
int Hello::Get(){
return this->_i;
}
基本上可以调用函数象:
[DllImport ("ex.dll")]
public extern static int Set(int i);但是为什么运行的时候提示无法找到ex.dll中set的入口??还有就是如果我想调用ex.dll文件中的类应该怎么写?ex.dll文件包括:
Hello.h:class Hello{
private:
int _i;
public:
void Set(int i);
int Get();
};Hello.cpp:#include ".\hello.h"
void Hello::Set(int i){
this->_i = i;
}
int Hello::Get(){
return this->_i;
}
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Technologies\Interop\PlatformInvoke\Custom
EXPORT
set 1@
Dllmain 2@