哪位高手帮帮忙将下面的码翻译成vb的代码?并给出简单的调用语句!谢谢
  Function tagOpen(port:integer):boolean;stdcall;external 'tagitfunction.dll' name 'tagOpen';
  Procedure tagClose;stdcall;external 'tagitfunction.dll' name 'tagClose';
  Function tagGetId(var idbuf:shortstring):integer;stdcall;external 'tagitfunction.dll' name 'tagGetId';
  Function tagBlockRead(blockNo:integer;var readBuf:shortstring):integer;stdcall;external 'tagitfunction.dll' name 'tagBlockRead';
  Function tagBlockWrite(blockNo:integer; writeBuf:shortstring):integer;stdcall;external 'tagitfunction.dll' name 'tagBlockWrite';
  Function tagBlockMRead(blockNo,Len:integer;var readBuf:shortstring):integer;stdcall;external 'tagitfunction.dll' name 'tagBlockMRead';
  Function tagBlockMWrite(blockNo:integer; writeBuf:shortstring):integer;stdcall;external 'tagitfunction.dll' name 'tagBlockMWrite';
  Function tagBlockLock(blockNo:integer):integer;stdcall;external 'tagitfunction.dll' name 'tagBlockLock';
  Function tagisBlockLock(blockNo:integer;var isLock:boolean):integer;stdcall;external 'tagitfunction.dll' name 'tagIsBlockLock';

解决方案 »

  1.   

    Private Declare Function tagOpen Lib "tagitfunction" (port as integer) As Boolean
      

  2.   

    好久没有用VB了。呵呵
    Private Declare Function tagOpen Lib "tagitfunction" (ByVal port as Long) As Boolean
    Private Declare  Sub tagClose Lib "tagitfunction.dll" ();
    Private Declare Function tagGetId Lib "tagitfunction.dll" (ByVal idBuf As String) As Integer
    Private Declare Function tagBlockRead Lib "tagitfunction.dll" (ByVal blockNo As Long,ByVal readBuf As String) As Integer
    Private Declare Function tagBlockWrite Lib "tagitfunction.dll" (ByVal blockNo As Long,ByVal writeBuf(255) As Byte) As Integer
    Private Declare Function tagBlockMRead Lib "tagitfunction.dll" (ByVal blockNo As Long,dwLen As Long,ByVal readBuf String) As Integer
    Private Declare Function tagBlockMWrite Lib "tagitfunction.dll" (ByVal blockNo As Long,ByVal writeBuf(255) As Byte) As Integer
    Private Declare Function tagBlockLock Lib "tagitfunction.dll" (ByVal blockNo As Long) As Integer
    Private Declare Function tagisBlockLock Lib "tagitfunction.dll" (ByVal blockNo As Long,ByRef isLock As Boolean) As Integer如果有问题就联系我阿
      

  3.   

    不是不行。如果你在Delphi中使用的string,在Vb中也许还可以使用string类型
      

  4.   

    Dim bArr() As Byte
    bArr = StrConv("abcd", vbFromUnicode)
    这个bArr就是了
      

  5.   

    核心问题:shortstring应该是一个256字节的数组,第一个字节指定串长度。
    那么做调用参数时:
       1:msg:shortstring:调用的应该是字符串的拷贝。
       2:var msg:shortstring:调用的应该是地址。
    上面的说法对吧!
    对应vb中怎么解决这些参数调用问题!请指点!