>How can I mimick the structure DRIVER_INFO_2 for use by the AddPrinterDriver function? The typedef is as follows:
>
>typedef struct _DRIVER_INFO_2 { // dri2
> DWORD cVersion;
> LPTSTR pName;
> LPTSTR pEnvironment;
> LPTSTR pDriverPath;
> LPTSTR pDataFile;
> LPTSTR pConfigFile;
>} DRIVER_INFO_2;
>
>I've tried using the following:
>drvString = "4.00" + chr(0) + "Generic" + chr(0) + "" + chr(0) + "tty.drv" + chr(0) + "" + chr(0) + "iconlib.dll"
>but even though the function returns .T., the driver is not actually installed.
>
>thanks!
Hi James,
The total length of the structure is 24 bytes. The LPTSTR members of the structure are pointers to the strings. You'd have to you something like Vlad Tatavu's Pointers Class to initialize those members. Additional, Ed Rauh has a program also in the files section that can take care of the allocation of the pointers, I believe. Finally, Christof Lange, has done some work in this area, utilizing an FLL. It's not available yet in the files section, but Christof has indicated that it will be.
hth,
George
Ubi caritas et amor, deus ibi est