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:
00720340
Views:
11
Hi Jose

I have tried the following code and am getting the same error DLL caused an exception.
DECLARE Long Logger_FileUpload IN c:\windows\system\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


lcFileName = "TEST.TXT"


	lcData = "This is just a text"
	lnSize = len(lcData)
	lcFileStruc = Alltrim(lcFileName)+Chr(0) && "name.ext"+null char
	lcFileStruc = Padr(lcFileStruc,13,Chr(0)) && padded to 13 bytes long
	For ln=1 to 4   && now add file size as a LONG integer
		lcFileStruc = lcFileStruc + chr(lnSize % 256)
		lnSize = int(lnSize/256)
	EndFor 


	lnStatus = Logger_FileUpload( @lcFileStruc, @lcData)
	MESSAGEBOX(lnStatus )
I could send you the DLL it's very small

Regards

John



>The data size seems to be missing in the lcFileStruct structure (for an upload, it should be an input parameter)
>
>Try this code for assigning lcFileStruc:
>
>	lcData = "This is just a text"
>	lnSize = len(lcData)
>	lcFileStruc = Alltrim(lcFileName)+Chr(0) && "name.ext"+null char
>	lcFileStruc = Padr(lcFileStruc,13,Chr(0)) && padded to 13 bytes long
>	For ln=1 to 4   && now add file size as a LONG integer
>		lcFileStruc = lcFileStruc + chr(lnSize % 256)
>		lnSize = int(lnSize/256)
>	EndFor
>
>
>Regards,
Previous
Reply
Map
View

Click here to load this message in the networking platform