Monday, March 20, 2006

Printer Trays Hell, View Pro and Vb 6

Hi Everyone,

I am a Windows Applications developer.

Have you come across hell when trying to specify printer's Paper Source Trays from Vb6 application? I have actually been to hell!

Problem:
VB 6
exposes a Printer object, which points to the currently active printer for the current user profile in Windows. You can manipulate this object directly and set the printer trays with easy. However, if you use a third party tool called ViewPro you may experience problems.


ViewPro hides the printer object and at times it passes the wrong values for the printer trays.

Cause
ViewPro exposes a property called 'DefaultSource' which is an Enum, whilst the printer tray Ids may not lie in the Enum definations


Result
Print jobs may not always print to the correct trays. You have to find ways of circumventing the ViewPro and print directly to the printer.

1 comment:

Easy Brains said...

ViewPro has a method that prints to a printer's DC. This resolves this problem