Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert from VB
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00719715
Message ID:
00720037
Views:
21
This should do it.
Of course I cannot test it without the DLL, so you may have to debug it.
Function FileDownload( lcFileName)
	Declare Long Logger_FileDownload in "Taglogger.dll" String @ FileNameStruct, String @ Data

	Local lcFileStruc && file name structure as defined for TAGLOGGERFILE
	Local lcData  && buffer to hold file contents
	Local lnStatus && return status
	Local lnSize

	lcFileStruc = Alltrim(lcFileName)+Chr(0) && "name.ext"+null char
	lcFileStruc = Padr(lcFileStruc,13,Chr(0)) && padded to 13 bytes long
	lcFileStruc = lcFileStruc + Replicate(Chr(0),4) && to get returned file size
	lcData = Space(50000) && max. file length, you may change this
	
	lnStatus = Logger_FileDownload( @lcFileStruc, @lcData)
	
	If lnStatus = 1
		lnSize = Asc(Substr(lcFileStruc,14)) ;
			+ Asc(Substr(lcFileStruc,15))*0x100;
			+ Asc(Substr(lcFileStruc,16))*0x10000;
			+ Asc(Substr(lcFileStruc,17))*0x1000000   && double word from string
	
		MessageBox("File content is:"+Chr(13)+Left(lcData, lnSize),64,"Success")
	Else
		MessageBox("Error status returned: "+Transform(lnStatus),48,"Failed")
	EndIf 
	
EndFunc
Regards,
Jose.
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform