> I'm trying to install a printer with the driver "Generic /
> Text only" on COM1 port on W2k. With "AddPrinterDriverEx"
> I load a DRIVER_INFO_4 structure, with previous copied
> files. After this I use "AddPrinter" for installing the
> printer. The printer doesn't work. When I reinstall the
> driver "Generic / Text Only" by the systems wizard it
> works properly.
> What is to do that I can install the generic driver
> programmatically?
Use GetPrinter() and GetPrinterDriver() on a pre-existing "good"
installation to determine what to specify in the AddPrinter()
and AddPrinterDriver() calls.
Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.
Adrian von Gunten
PENTAG Informatik AG
Wankdorffeldstrasse 102
3000 Bern 22
Switzerland
> I've tried it. The problem is with the Printer driver and
> not the AddPrinter function. I see the files unidrv.dll,
> tty.gpd, unidrvui.dll, unidrv.hlp unires.dll with the
> DRIVER_INFO_4 structure. I added the path I'd got with
> GetPrinterDriverDirectory to this filenames and called
> AddPrinterDriverEx. This call is successfully, I can see
> the driver with GetPrinterDriver, The files are copied to
> the version depending subdirectory (here it's 3),
> everything looks fine. But when I start to use the printer
> with the driver it doesn't work. A reinstall with the
> wizard is needed and the printer works. When I look again
> to the DRIVER_INFO 4 structure I can't see any changes.
> I've noticed that the wizard adds additionally files like
> tty.dll, tty.bud, tty.ini etc.
> My questions are what is needed else to start a
> generic /text only driver working to the serial port? Do
> you have an example exactly for this driver? Or can I see
> somewhere what is the "Add printer driver" wizard exactly
> doing?
It sounds like you're not handling the dependent files
properly. As noted in the docs, it is a double-NULL terminated
string. In other words, it can look like this:
"file1.dll\0file2.dll\0file3.dll\0\0"
You're probably just parsing the first filename and missing
the rest.
Read the docs to determine how to handle each member of the struct.
Adrian von Gunten
Pentag Informatik AG
3000 Bern 22