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:
00720745
Views:
12
Hi Ed

Sorry to bother you again but I have managed to make some of the code work.
The following code does not cause an error. The line I added was
 cDataBlock = REPLICATE(CHR(0),5000)
The file is now uploaded but there is no data uploaded. I was wondering if it had something to do with where the cDataBlock is stored in memory?

John
DECLARE Long Logger_Init IN c:\windows\system\taglogger.dll Long ComPort
i = Logger_Init(2)


DECLARE INTEGER  Logger_FileUpload IN c:\windows\system\taglogger.dll STRING @ Tagloggerfile, STRING @ DataBlock


SET PROC TO "d:\vfp projects2\vfp base\clsheap.prg" ADDI
 

cDataBlock = REPLICATE(CHR(0),5000)


cUploadFileName = "Test.txt" 
cDataBlock = "Hello" 

cTaggerLogFileStruc = PADR(ALLTRIM(cUploadFileName),13,chr(0)) + NumToLong(LEN(cDataBlock))

nResult = Logger_FileUpload(@cTaggerLogFileStruc,cDataBlock)
>>The error occurs when it reached the lnStatus = Logger_FileUpload(@lcFileStruc, @lcData) part
>>
>
>Just out of curiousity, did you ever try appending a NULL character to the end of your data buffer? Maybe it expects a null terminator in the last position - I can't imagine why since you have to pass it a filelength, but it's worth a SWAG.
>
>>John.
>>
>>>>How do I find out?
>>>>
>>>
>>>I can't see anything; it looks like the code should be correct. It's actually blowing yp at the point that you are doing the DECLARE...DLL; the only thing I can suggest is to try using the FOXTOOLS RegFn() and CallFn() routines to see if they handle it any better, or write a wrapper in VB.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform