我刚学习VB不久,照着书上的例子写了一个程序。
程序代码如下:
Dim value_byte(1) As Byte
Error = a_field_read(0, 1, value(0))
If Error <> 0 Then
  TxtShow = "a_field_read error:" & Hex(Error)
  MsgBox ("a_field_read error")
Else
  TxtShow.Text = "Output Value=" & Hex(value_byte(0))
End If
模块声明如下:
Type plcadrtype
address As Byte
segmentid As Byte
slotno As Byte
rackno As Byte
End TypeDeclare Function load_tool Lib "w95_s7.dll" (ByVal nr As Byte, ByVal dev As String, adr As plctype) As Long
Declare Function a_field_read Lib "w95_s7.dll" (ByVal no As Byte, ByVal amount As Long, value As Byte) As Long
Declare Function unload_tool Lib "w95_s7.dll" () As Long
运行的时候出现“无效外部过程”。请问“无效外部过程”是什么意思啊?在请教高人看看我程序哪里出现问题。