dll调用问题
最近想写一个光标阅读机的的程序,要调用OMRCLIEN.DLL文件,下面这段程序放在VB6里能通过,由于一些原因,我现在需要在VS2010里用VB..net 做,但没成功,望高手指点.--------------------编程问答-------------------- 看你 原来的声明都是string类型,那你也用string试试,ref string xxx
Private Declare Function OmrS Lib "OMRCLIEN.DLL" (ByVal Buffer As String) As Integer
Private Declare Function OmrG Lib "OMRCLIEN.DLL" (ByVal Buffer As String) As Integer
Private Declare Function TmOmrGetStatu Lib "OMRCLIEN.DLL" (ByVal Buffer As String) As Integer
Private Declare Function TmOmrGetValue Lib "OMRCLIEN.DLL" (ByVal Buffer As String) As Integer
Private Sub Command1_Click()
Dim Buf As String
Buf = "S E:\gs.txt/"
OmrS (Buf)
Buf = "/"
OmrS (Buf)
OmrG (Buf)
If Left(Trim(Buf), 1) = "O" Then
Buf = "001" + Space(120) + "/"
OmrS (Buf)
OmrG (Buf)
MsgBox Buf
TmOmrGetStatu (Buf)
If Left(Trim(Buf), 2) = "O" Then
TmOmrGetValue (Buf)
End If
Else
If Buf <> "16" Then
MsgBox "ERR--" + Buf
End If
End If
End Sub
dll引入用
[DLLImport] --------------------编程问答-------------------- 楼上能详细点吗,谢谢,对于VS2010的dll调用不太熟悉 --------------------编程问答-------------------- 你连哪里不成功都没说 --------------------编程问答-------------------- 你定的数据引用类型要注意到是传值,还是引用,byval ,还是byref
补充:.NET技术 , VB.NET