各位好:
    VC 写的DLL ,函数int  __stdcall EPRPersonInfo(HANDLE icdev,char *strShbzh,char*Name,char*sex,char*strSfhm,char *strRylb);
DEF 文件
EXPORTS
EPRPersonInfo VB 中调用,提示约定错误,若不给参数,VB 调用成功。VB 中的声明
Declare Function EPRPersonInfo Lib "EPReadDll.dll" (ByVal icdev, ByVal strShbzh$, ByVal Name$, ByVal sex$, ByVal strSfhm$, ByVal strRylb$) As Integer调用:
Dim shbzh As String * 100
Dim sname As String * 100
Dim sex As String * 10
Dim sfhm As String * 100
Dim rylb As String * 100 EPRPersonInfo(icdev, shbzh, sname, sex, sfhm, rylb)
请各位专家帮忙诊断!
谢谢!

解决方案 »

  1.   

    声明换这个试试
    Declare Function EPRPersonInfo Lib "EPReadDll.dll" (ByVal icdev as Integer, ByVal strShbzh as String, ByVal Name as String, ByVal sex as String, ByVal strSfhm as String, ByVal strRylb as String) As Integer 
      

  2.   

    问题解决了,非常感谢akirya 。主要是函数声明的问题,按照的你的说法去做了,然后把VC 中的函数声明_stdcall 去掉 。
      

  3.   

    你好我现在的函数是:extern "C" int __declspec(dllexport)PassPortRead(char *InPutData,char OuPutData[255]);
    VB声明是:Private Declare Function PassPortRead Lib "PPRead.dll" (ByVal InPutData As String, ByVal OutPutData As String) As Integer
    生成的文件能正常运行,但是在调试时提示"DLL调用约定错误"
      

  4.   

    你好我现在的函数是:extern "C" int __declspec(dllexport)PassPortRead(char *InPutData,char OuPutData[255]);
    VB声明是:Private Declare Function PassPortRead Lib "PPRead.dll" (ByVal InPutData As String, ByVal OutPutData As String) As Integer
    生成的文件能正常运行,但是在调试时提示"DLL调用约定错误"
    E_Mail:[email protected]