我想做个打印机驱动程序自动安装,
用AddPrinterDriver 和 AddPrinter两个函数做,
在手工装驱动后AddPrinter函数工作的很好。
但使用AddPrinterDriver却怎样都不行。
不晓得PDriverInfo3参数怎样写,大家有没有具体的例子。
只要关于AddPrinterDriver的就可以了,如果我搞不定的话可能要失业了。
大伙帮帮忙,分不够可以再加的

解决方案 »

  1.   

    The DRIVER_INFO_3 structure contains printer driver information. typedef struct _DRIVER_INFO_3 { // dri3  
        DWORD  cVersion; 
        LPTSTR pName; 
        LPTSTR pEnvironment; 
        LPTSTR pDriverPath; 
        LPTSTR pDataFile; 
        LPTSTR pConfigFile; 
        LPTSTR pHelpFile; 
        LPTSTR pDependentFiles; 
        LPTSTR pMonitorName; 
        LPTSTR pDefaultDataType; 
    } DRIVER_INFO_3; 
     MemberscVersionSpecifies a printer-driver version number. pNamePoints to a null-terminated string that specifies the name of the driver (for example, "QMS 810"). pEnvironmentPoints to a null-terminated string that specifies the environment for which the driver was written (for example, "Windows x86" or "Windows NT R4000"). pDriverPathPoints to a null-terminated string that specifies a filename or full path and filename for the file that contains the device driver (for example, "C:\DRIVERS\PSCRIPT.DLL"). pDataFilePoints to a null-terminated string that specifies a filename or a full path and filename for the file that contains driver data (for example, "C:\DRIVERS\QMS810.PPD"). pConfigFilePoints to a null-terminated string that specifies a filename or a full path and filename for the device driver's configuration dynamic-link library (for example, "C:\DRIVERS\PSCRPTUI.DLL"). pHelpFilePoints to a null-terminated string that specifies a filename or a full path and filename for the device driver's help file.pDependentFilesPoints to a null-terminated string that specifies the files the driver is dependent on. Each filename in the string is also terminated with a null (for example, "PSCRIPT.DLL\0QMS810.PPD\0PSCRPTUI.DLL\0PSPCRIPTUI.HLP\0PSTEST.TXT\0\0").pMonitorNamePoints to a null-terminated string that specifies a language monitor (for example, "PJL monitor"). This member can be NULL and should be specified only for printers capable of bidirectional communication.pDefaultDataTypePoints to a null-terminated string that specifies the default data type of the print job (for example, "EMF").
      

  2.   

    AddPrinterDriver调用以前,驱动程序所需要的所有文件必须要拷贝到系统的打印机驱动程序目录下
      

  3.   

    我也拷贝了,在这个目录下C:\WINNT\system32\spool\drivers\w32x86\3,但还是不行
    naughtyboy能请教你吗?我的QQ:150383457
    这件事真的很急,我都搞了几天了
      

  4.   

    呵呵
    恭喜楼主了
    公司不让上QQ,没办法
    sigh