Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Help with Keybd Macros
Message
 
To
24/04/1997 16:33:28
Vernon Moeller
Texas Adjutant General's Department
Austin, Texas, United States
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00028603
Message ID:
00029622
Views:
42
Hi Vernon,

First, in assigning the new printer, some of the information
needs to be removed. Here's the revision:

Get the necessary information for the Generic/Text Only printer.

m.buffer = SPACE(100) + CHR(0)
m.buflen = LEN(m.buffer)
m.buflen = CallFN(m.getstr, 'PrinterPorts', 'Generic / Text Only',;
"", @buffer, m.buflen)
m.txtprn = LEFT(m.buffer, m.buflen)

* Adding the following
m.txtprn = LEFT(m.txtprn, AT(':', m.txtprn))
* End addition

m.newdefprn = 'Generic / Text Only,' + m.txtprn
= CallFN(m.writestr, m.winsect, 'device', m.newdefprn)

etc.

Your problem may be caused be not sending back the original
default as you got it. I experienced the same problem you had
by sending the wrong information. The format of the string
should be:

,,

For example:

Generic / Text Only,TTY,LPT1:

When you retrieve information from the PrinterPorts, you need to
remove everything after the port. That's what the new line does.

I switched between a regular printer and the generic on LPT1:
from the command window I (after making the above change) didn't
have the problem.

If you have any other questions or problems, either post or email
me at GTasker@compuserve.com. I don't mind having my goofs
(like this one) posted for all the world to see.

My apologies for any inconvenince.

Good Luck,

George
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform