vb 调用 VC7 dll

ttlb 2005-11-06 05:18:16

VC7中 dll中的 函数定义
extern "C" BSTR __declspec(dllexport) eomDoConversation(BSTR str)
{
return SysAllocString(L"SSSSSSSS");
}

VB 调用:
Private Declare Function eomDoConversation Lib "EomIA.dll" (ByVal fromClient As Long) As String
Dim InString As String
Dim OutString As String
OutString = eomDoConversation(StrPtr(InString))

每次都说“bad dll calling convention”
我把C++的调用约定改为"__cdecl (/Gd)"还是不行,怎么回事呀?
...全文
114 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yayaniuniu502 2005-11-07
  • 打赏
  • 举报
回复
vb调用vc7的dll?没试过,但是vc6的用过可以,没遇到你的问题
oyljerry 2005-11-06
  • 打赏
  • 举报
回复
为了兼容,要用WINAPI /STDCALL等标准函数调用约定
ttlb 2005-11-06
  • 打赏
  • 举报
回复
up
ttlb 2005-11-06
  • 打赏
  • 举报
回复
如果设成 stdcall, 就说找不到入口

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧