Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Code
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Convert Code
Miscellaneous
Thread ID:
00720610
Message ID:
00720610
Views:
46
Can anyone help me convert this VB code to VFP7
'Define the datatype TagloggerFile, used by some of the DLL-functions
Public Type TagloggerFile
  filename(1 To 13) As Byte
  filelength As Long
End Type



Declare Function Logger_FileUpload Lib "Taglogger.dll" (ByRef filename As TagloggerFile, ByVal data As String) As Long


 Dim file As TagloggerFile
  Dim data As String * 50000
  Dim filename As String
  Dim k As Integer
  Dim filedata As String
  Dim status As Long
    
    
  'Name and contents of the file to be uploaded to the Taglogger
  filename = "dlltest1.txt"
  filedata = "This is a test of the Logger_FileUpload function."
  
  
  'Convert string to array of bytes padded with nullbytes
  For k = 1 To 13
    If k <= Len(filename) Then
      file.filename(k) = Asc(Mid(filename, k, 1))
     Else
      file.filename(k) = 0
    End If
  Next
  
  file.filelength = Len(filedata)
  data = filedata
  
  status = Logger_FileUpload(file, data)
Thanks

John
Next
Reply
Map
View

Click here to load this message in the networking platform