Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with fopen in VFP
Message
From
03/06/1999 16:06:20
 
 
To
03/06/1999 15:51:58
Glenn Rainey
Milestone Computer Solutions, Llc
Asheboro, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00226188
Message ID:
00226206
Views:
47
>We're converting a FoxPro 2.5/DOS application to VFP 6.0. One of the functions of the application was uploading data from a handheld bar-code scanner through the PC's serial port. In the DOS application, we were able to do this quite easily with fopen, etc. Unfortunately, trying to open the COM port with fopen under VFP either returns a -1 saying that the port couldn't be opened or generates the dreaded 'Invalid seek offset' message. I've tried with 3.0, 5.0 and 6.0 and get the same results.
>

Instead of using the low-level file handlers like in FPDOS, you'll need to use an ActiveX control to handle serial ports. MSCOMM32.OCX comes with VFP, and there are samples here on UT in the FAQ that demostrate some of the functionality. There's detailed documentation in the MSDN, but it's using VB; the conversion between VB and VFP syntax is pretty easy.

>Am I overlooking something or is this a known problem with VFP? If so, does anyone have any workarounds?
>
>TIA,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform