|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Call a DLL in C from VBI have the code as below: ( this is vb version ) Public Declare Function Retrivexxxx Lib "A.dll" (ByRef str As Byte) As Integer Public Declare Function SendDatatoxxx Lib "A.dll" (ByRef buf As Byte, ByVal nbufSize As Integer, ByRef strRet As Byte) As Boolean Public Declare Function Receivexxxdata Lib "A.dll" (ByRef buf As Byte, ByVal nbufSize As Integer, ByRef nRetBytes As Integer) As Boolean Public Declare Function Inp Lib "A32.dll" Alias "I32" (ByVal PortAddress As Integer) As Integer Public Declare Sub Out Lib "A32.dll" Alias "O32" (ByVal PortAddress As Short, ByVal Value As Short) could you please advice how to convert it in vc version ? Thank you very much! Best regards, Boki. Short = Integer in VB
Byte is fine As Boolean should be As Long in VB Note too that if the DLL's declares are in cdecl, you won't be able to call the APIs from VB directly; they must be declared as stdcall. If this is the case, see Matt Curland's book at http://www.awprofessional.com/bookstore/product.asp?isbn=0201707128&rl=1 -- Randy Birch MS MVP Visual Basic http://vbnet.mvps.org/ Please reply to the newsgroups so all can participate. <bokit***@ms21.hinet.net> wrote in message news:1141957996.072702.213420@v46g2000cwv.googlegroups.com... I have the code as below:Hi All, ( this is vb version ) Public Declare Function Retrivexxxx Lib "A.dll" (ByRef str As Byte) As Integer Public Declare Function SendDatatoxxx Lib "A.dll" (ByRef buf As Byte, ByVal nbufSize As Integer, ByRef strRet As Byte) As Boolean Public Declare Function Receivexxxdata Lib "A.dll" (ByRef buf As Byte, ByVal nbufSize As Integer, ByRef nRetBytes As Integer) As Boolean Public Declare Function Inp Lib "A32.dll" Alias "I32" (ByVal PortAddress As Integer) As Integer Public Declare Sub Out Lib "A32.dll" Alias "O32" (ByVal PortAddress As Short, ByVal Value As Short) could you please advice how to convert it in vc version ? Thank you very much! Best regards, Boki. "Randy Birch" <rgb_removet***@mvps.org> wrote in message And, similarly, what most languages call an "integer" or "int" must be news:%23uDwCe$QGHA.4792@TK2MSFTNGP14.phx.gbl... > Short = Integer in VB declared Long in VB.
how to convert string to date?
problem formatting excel in vb VB6 writing to text files requires Close to commit Text to Speech delete tmp files Collection of Radio buttons Function VB6 File Handling Without FSO Using VB to screen scrape a 3270 mainframe object variable or with block variable not set error Error to create a package in VB6 |
|||||||||||||||||||||||