I've got some problems getting VB to interface with the PB_FTP DLL, and I'm having trouble with figuring out how the following is happening:
in PB/DLL these two example declares are made:
FUNCTION ftpChangeDir ALIAS "ftpChangeDir" (BYVAL hSocket AS LONG, sDir AS STRING) EXPORT AS LONG
FUNCTION ftpPutFile ALIAS "ftpPutFile" (BYVAL hSocket AS LONG, sServer AS STRING, BYVAL hStatus AS LONG, remoteFile AS STRING, localFile AS STRING) EXPORT AS LONG
and in VB, I declare them as such:
Private Declare Function ftpChangeDir Lib "Pb_ftp.dll" (ByVal hSocket As Long, ByRef sDir As String) As Long
Private Declare Function ftpPutFile Lib "Pb_ftp.dll" (ByVal hSocket As Long, ByVal hStatus As Long, ByRef remoteFile As String, ByRef localFile As String) As Long
Okay, they look very similar as far as the ByRef's go.. But when I call ftpChangeDir, it works fine, and when I call ftpPutFile, it dies on me.. Adding a "MSGBOX localFile" in the start of ftpPutFile shows me that the string is garbled. However, the string in ftpChangeDir is NOT garbled... This seems to be the case regardless of any combination of ByRef / ByVal, or in PB with String / ASCIIZ... What is going on?
------------------
in PB/DLL these two example declares are made:
FUNCTION ftpChangeDir ALIAS "ftpChangeDir" (BYVAL hSocket AS LONG, sDir AS STRING) EXPORT AS LONG
FUNCTION ftpPutFile ALIAS "ftpPutFile" (BYVAL hSocket AS LONG, sServer AS STRING, BYVAL hStatus AS LONG, remoteFile AS STRING, localFile AS STRING) EXPORT AS LONG
and in VB, I declare them as such:
Private Declare Function ftpChangeDir Lib "Pb_ftp.dll" (ByVal hSocket As Long, ByRef sDir As String) As Long
Private Declare Function ftpPutFile Lib "Pb_ftp.dll" (ByVal hSocket As Long, ByVal hStatus As Long, ByRef remoteFile As String, ByRef localFile As String) As Long
Okay, they look very similar as far as the ByRef's go.. But when I call ftpChangeDir, it works fine, and when I call ftpPutFile, it dies on me.. Adding a "MSGBOX localFile" in the start of ftpPutFile shows me that the string is garbled. However, the string in ftpChangeDir is NOT garbled... This seems to be the case regardless of any combination of ByRef / ByVal, or in PB with String / ASCIIZ... What is going on?
------------------
Comment