dll调用时的问题,急呀。
我的DLL代码
extern "C" void _declspec(dllexport)
__stdcall SplitWord(char *a,char*b)
{
}
调用代码
#include <iostream.h>
#include <Windows.h>
void main(){
//typedef int (*ADD)(int ,int);//函数指针类型
//加载我们刚才生成的dll
//ADD add = (ADD)GetProcAddress(Hint,"add");//取得dll导出的add方法
char *a,*b;
a="abcd";
b=NULL;
typedef void (__stdcall *SP)(char*,char*);
HINSTANCE Hint = ::LoadLibrary("Test002.dll");
SP swTest=GetProcAddress(Hint,"SplitWord");
swTest(a,b);
cout<<a<<endl;
cout<<b<<endl;
}
错误提示:
cannot convert from 'int (__stdcall *)(void)' to 'void (__stdcall *)(char *,char *)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
为甚么我的DLL导出的时'int (__stdcall *)(void)'啊?
给各正确答案啊,谢谢了