Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

APRINTERS - slow on some machines

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,305
FR
Hi All,

I've just had a small problem - APRINTERS() is taking a very long time to process on some machines - about 20 seconds to a minute!

Anyone know how to speed it up? I only want the printer names.

Martin

Regards

Griff
Keep [Smile]ing
 
Hi Mike,

Some are local, some remote - some with pretty naff drivers too.

They are all good on some machines, even on the same network, and on some machines there is a delay.

It's just a bit irritating.

Martin



Regards

Griff
Keep [Smile]ing
 
Griff,

It usually happens with network printers. I think VFP has to resolve the path to the network resource or something.

Maybe you could call APRINTERS only once and then store the information for use later. That way you only take the single hit.

Andy

 
Andy,

I am calling it just once, close to the beginning of the app (in fact it's the same on nearly all my apps - except the ones that don't need to print).

All I use it for is to ensure that any application specific 'default printer' actually exists at runtime.

This prevents problems when the user has specified a printer yesterday, which isn't there today.

Ta all

Martin

Regards

Griff
Keep [Smile]ing
 
Griff,

Maybe an API call to get the printers would be quicker? I don't know... if it continues to be a problem maybe it's worth a look. Although that's probably all VFP is doing in the background when you call APRINTERS().

Something like EnumPrinters IN winspool.drv is what I'm speaking of. Good luck.

Andy
 
Thanks Andy,

I might try that

Martin

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top