ByRef privatekeytimeout As Long, ByRef rootcertdevicetype As Integer, 
->
ByVal privatekeytimeout As Long, ByVal rootcertdevicetype As Integer, 

解决方案 »

  1.   

    改成ByVal也不行,报错:内存不能读
      

  2.   

    试一试这么写:
    Declare Sub SE_InitialSession Lib "E:\Winnt\System32\SafeEngine.dll" (ByVal privatekeydevicetype As Integer, ByVal privatekeydeviceparameter As String, ByVal privatekeypassword As String, ByRef privatekeytimeout As Long, ByRef rootcertdevicetype As Integer, ByVal rootcertdeviceparameter As String, ByVal rootcertpassword As String)
      

  3.   

    试过了,报Runtime49 error:Bad DLL calling convention!
      

  4.   

    能不能把那些As Integer都该成As Long 试一试?
      

  5.   

    试了也不行。得了我这么问吧,那位告诉我C中的char *p 在VB中怎么声明及调用
      

  6.   

    在VB里声明如下Declare Function SE_InitialSession Lib "E:\Winnt\System32\SafeEngine.dll" (ByVal privatekeydevicetype As Integer, ByVal privatekeydeviceparameter As String, ByVal privatekeypassword As String, ByRef privatekeytimeout As Long, ByRef rootcertdevicetype As Integer, ByVal rootcertdeviceparameter As String, ByVal rootcertpassword As String) As Long
    As String 全改为As Long
      

  7.   

    在DLL中声明为:long __stdcall SE_InitialSession(...
      

  8.   

    这不是 String 与 Long 之间的问题,而是你参数变量定义的问题:
    在定义String变量时,或将其定义为定长类型,或为其分配存储空间。
    还有问题来信:
    [email protected]