Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return binary data to web server from VFP using C
Message
 
To
03/04/2003 13:32:12
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00773698
Message ID:
00774346
Views:
18
Still at it building a home made solution, huh? <g>

printf() doesn't handle CHR(0)'s as it sees it as a string terminator. You can use File output functions to write to StdOut as well such as WriteFile() API calls to which you can pass output, or fWrite() (you have to get the handle to StdOut for that first).

You can write to StdOut from VFP using Windows API calls with CreateFile, WriteFile() and CloseHandle() ( I think ), but htis is a really bad idea as VFP is way too large to load up from scratch on every CGI hit.

+++ Rick ---




>I created a VFP 7 CGI application using vfpcgi which returs PDF files.
>
>I noticed that zero bytes (0x00) are not passed to web server.
>
>This is because mycgi.c shipped with vfp uses
>
>printf( "%s", buffer );
>
>to return data to web server . printf() stops writing if zero byte is
>reached.
>
>It is possible to fix this by changing mycgi.c file and re-creating an exe
>file.
>
>Unfortunately, I don't have Microsoft VC++ compiler required to
>create vfpcgi.exe
>
>Can anybody create a correct vfpcgi.exe file or is there correct
>vfpcgi module available somewhere ?
>
>Is it possible to read stdin and write to stdout from a VFP 7 application ?
>This will eliminate the need of using vfpcgi.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform