vc6编写的dll程序
extern "C" _declspec(dllexport) bool ReadString(LPCSTR lpString)
{
....
}
*.def文件
EXPORTS
ReadString
VB中的程序:
Private Declare Function ReadString Lib "commication.dll" (ByVal send As String) as Boolean
调用时返回49,DLL调用约定错误
后改为
extern "C" _declspec(dllexport) bool __stdcall ReadString(LPCSTR lpString)
{
....
}
其他不变,调用时返回453,没有入口。拼写肯定没有错误。用dumpbin看,输出_ReadString@16,可是我写*.def文件了,也用extern "C"了。我把文件名改为*.c也不可以。
我都是照网上写的作的呀!
Private Declare Function ReadString Lib "commication.dll" (ByVal send As String) as Long
或
Private Declare Function ReadString Lib "commication.dll" (ByVal send As Any) as Long
{
....
}Declare Function ReadString Lib "commication.dll" (ByVal send As String) as Byte
我理解是不加__stdcall,调用约定错误,但是加了以后输出就不对了.变为c++输出了。大家帮帮,看看我该怎么办。
我去掉extern "C" _declspec(dllexport) 后,编译出的dll,用dumpbin看exports没有输出呀。是不是我的def文件有问题?
EXPORTS
FunName
就可以了?library libname.dll是不是必须的?
DESCRIPTION "Implements a binary tree." <-- 可选
EXPORTS
Insert @1
Delete