請教關於用程式新增印表機 |
尚未結案
|
SnP
一般會員 發表:11 回覆:19 積分:6 註冊:2003-03-03 發送簡訊給我 |
|
小蟲蟲
一般會員 發表:38 回覆:55 積分:23 註冊:2002-03-13 發送簡訊給我 |
|
SnP
一般會員 發表:11 回覆:19 積分:6 註冊:2003-03-03 發送簡訊給我 |
|
小蟲蟲
一般會員 發表:38 回覆:55 積分:23 註冊:2002-03-13 發送簡訊給我 |
在MSDN中,我有找到兩種方法,一種就是AddPrinter,另一種是用rundll。(嘿…我目前也是在解決這個問題…)。
就如您所述,使用AddPrinter需要驅動程式檔案,目前我還不是很清楚如何由印表機所附的檔案,找出所需的driver。還要再研究研究。
http://support.microsoft.com/default.aspx?scid=kb;en-us;147202
這篇有提到幾個步驟:
1. Fill out a DRIVER_INFO_2 structure with the appropriate driver information for the network printer.
2. Copy the driver files to your Windows 95 System directory.
3. Call AddPrinterDriver() to add the printer driver to Windows 95.
4. Fill out a PRINTER_INFO_2 structure, and place a pointer to the server and share name in the pPortName field.
5. Call AddPrinter() to add the printer to the system. http://support.microsoft.com/default.aspx?scid=kb;en-us;189105
這篇是用rundll的方法。
rundll32 printui.dll,PrintUIEntry /Xs /n\\SERVER\PRINTERSHARENAME DriverName "Lexmark C752 PS3"
|
SnP
一般會員 發表:11 回覆:19 積分:6 註冊:2003-03-03 發送簡訊給我 |
引言: 在MSDN中,我有找到兩種方法,一種就是AddPrinter,另一種是用rundll。(嘿…我目前也是在解決這個問題…)。 就如您所述,使用AddPrinter需要驅動程式檔案,目前我還不是很清楚如何由印表機所附的檔案,找出所需的driver。還要再研究研究。 http://support.microsoft.com/default.aspx?scid=kb;en-us;147202 這篇有提到幾個步驟: 1. Fill out a DRIVER_INFO_2 structure with the appropriate driver information for the network printer. 2. Copy the driver files to your Windows 95 System directory. 3. Call AddPrinterDriver() to add the printer driver to Windows 95. 4. Fill out a PRINTER_INFO_2 structure, and place a pointer to the server and share name in the pPortName field. 5. Call AddPrinter() to add the printer to the system. http://support.microsoft.com/default.aspx?scid=kb;en-us;189105 這篇是用rundll的方法。 rundll32 printui.dll,PrintUIEntry /Xs /n\\SERVER\PRINTERSHARENAME DriverName "Lexmark C752 PS3"一開始打算從第一種方式來處理,但是程式並不知道使用者端他的印表機是哪一牌的,連同驅動程式也未知,這樣無法達到需求,後來改用送訊息給新增印表機畫面,這一個功能才某種程度符合需要說 。若是統一一個牌子或如公司自動畫設定,第二種方法是一個蠻實用的方式 :) |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |