Z
zhang
Unregistered / Unconfirmed
GUEST, unregistred user!
我在DELPHI中编写一个简单DLL,源码如下:<br>library project1;<br><br>uses<br> SysUtils,<br>Classes;<br><br>function in_portb(port:integer):integer;export;<br>var dsr:smallint;<br>begin<br> asm<br> mov ax,0<br> mov dx,port<br> in al,dx<br> mov dsr,ax<br> end;<br> result:=dsr;<br>end;<br><br>exports<br> in_portb index 1 name 'in_portb';<br><br>begin<br>end.<br> <br>在VB中调用,出现调用49号错误,为什么?<br>Private Declare Function in_portb Lib "c:/project1.dll" _<br>(ByVal port As Integer) As Integer<br><br>Private Sub Command1_Click()<br>in_portb (330)<br>End Sub<br>