Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overlaying an insurance form onto a laser printed report
Message
From
19/10/1998 14:19:13
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00112699
Message ID:
00148229
Views:
32
>>I copy the macro to the printer as a permanent macro before the application starts, so that all the macros that I might reference are present before I need them; typically, we have a batch job that runs once a day to copy the files containing the permanent macros to the printers involved, and that need only be run after the printers are turned off and back on.
>>
>>hth,
>>
>>Ed
>
>How do you copy the macro to the printers? Can you do it inside of VFP? I can only get it to work by doing :
>! COPY mymacro LPT2 /b
>
>This brings up the annoying dos window and just doesn't seem right. When I issue: COPY FILE myMacro TO LPT2.DOS --I get not enough disk space. (100k macro, with 2mg of printer memory) If I do: COPY FILE myMacro TO LPT2 --I get invalid seek offset.
>

Any number of ways to do this; using an API call (CreateProcess() or ShellExecute() to execute a COPY command, or using CopyFile() suggest themselves immediately.) I use CopyFile() as follows:
DECLARE SHORT CopyFile IN Win32API ;
   STRING @lpSource, ;
   STRING @lpDest, ;
   SHORT boolFailIfExists

IF CopyFile('MyMacroFile.BIN','LPT2:',0) = 1
   *  It worked
ELSE
   * It didn't
ENDIF
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
Next
Reply
Map
View

Click here to load this message in the networking platform