以下是别人提供给我的VB调用DLL的函数,但我不知VB请大侠们根据VB的函数的写法给我写成可调用的函数.
Declare Function cd5111 Lib "comdll2" (ByVal str As String) As Long
Public Declare Function SetWindowText Lib "user32" _
Alias "SetWindowTextA" (ByVal hwnd As Long, _
ByVal lpString As String) As Long请将上面两个函数转成DELPHI的函数.Private Sub Command1_Click()
Dim test As String
test = Text1.Textcd5111 testEnd Sub

解决方案 »

  1.   

    Function cd5111(str:String):integer;
    Function SetWindowText(hwnd : Long;lpString : String) : Long;
      

  2.   

    delphi_han(小强):
    老兄看来你也没有看明白VB的函数,它是在调用comdll2.dll,你只是给我写了一个简单的函数!
      

  3.   

    to delphi_han(小强):
    Declare Function cd5111 Lib "comdll2" (ByVal str As String) As Long
    这个函数是VB用写的调用comdll2.dll往端口上发字符串,
    我的意思是这个函数在中应该怎样写?这个comdll2.dll是别人写好的.
      

  4.   

    function cd5111(str:pchanr):integer;stdcall external comdll2.dll' name 'cd5111';
      

  5.   

    function cd5111(str:pchanr):integer;stdcall external 'comdll2.dll' name 'cd5111';