




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、動(dòng)態(tài)鏈接庫(kù)DLL的使用1 動(dòng)態(tài)鏈接庫(kù)的概念2 動(dòng)態(tài)鏈接庫(kù)的優(yōu)點(diǎn)3 DLL指令4 Visual Basic 5.0, 6.0 下TSC函式庫(kù)的應(yīng)用5 FoxPro下TSC函式庫(kù)的應(yīng)用6 Delphi下TSC函式庫(kù)的應(yīng)用請(qǐng)?jiān)谑褂肨SCLIB.DLL之前1 動(dòng)態(tài)鏈接庫(kù)的概念 動(dòng)態(tài)鏈接庫(kù)(Dynamic Link Library,縮寫(xiě)為DLL)是一個(gè)可以被其它應(yīng)用程序共享的程序模塊,其中封裝了一些可以被共享的例程和資源。動(dòng)態(tài)鏈接庫(kù)文件的擴(kuò)展名一般是dll,也有可能是drv、sys和fon,它和可執(zhí)行文件(exe)非常類(lèi)似,區(qū)別在于DLL中雖然包含了可執(zhí)行代碼卻不能單獨(dú)執(zhí)行,而應(yīng)由Windows應(yīng)用程序
2、直接或間接調(diào)用。 動(dòng)態(tài)鏈接所調(diào)用的函數(shù)代碼并沒(méi)有被拷貝到應(yīng)用程序的可執(zhí)行文件中去,而是僅僅在其中加入了所調(diào)用函數(shù)的描述信息(往往是一些重定位信息)。僅當(dāng)應(yīng)用程序被裝入內(nèi)存開(kāi)始運(yùn)行時(shí),在Windows的管理下,才在應(yīng)用程序與相應(yīng)的DLL之間建立鏈接關(guān)系。當(dāng)要執(zhí)行所調(diào)用DLL中的函數(shù)時(shí),根據(jù)鏈接產(chǎn)生的重定位信息,Windows才轉(zhuǎn)去執(zhí)行DLL中相應(yīng)的函數(shù)代碼。 2 動(dòng)態(tài)鏈接庫(kù)的優(yōu)點(diǎn)1. 共享代碼、資源和數(shù)據(jù) 使用DLL的主要目的就是為了共享代碼,DLL的代碼可以被所有的Windows應(yīng)用程序共享。2. 隱藏實(shí)現(xiàn)的細(xì)節(jié)DLL中的例程可以被應(yīng)用程序訪問(wèn),而應(yīng)用程序并不知道這些例程的細(xì)節(jié)。3. 拓展開(kāi)發(fā)
3、工具如Delphi的功能由于DLL是與語(yǔ)言無(wú)關(guān)的,因此可以創(chuàng)建一個(gè)DLL,被C+、VB或任何支持動(dòng)態(tài)鏈接庫(kù)的語(yǔ)言調(diào)用。這樣如果一種語(yǔ)言存在不足,就可以通過(guò)訪問(wèn)另一種語(yǔ)言創(chuàng)建的DLL來(lái)彌補(bǔ)。說(shuō)明: 指定計(jì)算機(jī)端的輸出端口 參數(shù):a:?jiǎn)螜C(jī)打印時(shí),請(qǐng)指定打印機(jī)驅(qū)動(dòng)程序名稱(chēng), 例如: TSC TTP/TDP-243(E) 若連接打印機(jī)服務(wù)器,請(qǐng)指定服務(wù)器路徑及共享 打印機(jī) 名稱(chēng), 例如: SERVERTTP2433 DLL指令3.1 openport(a)3.2 closeport() 說(shuō)明: 關(guān)閉指定的計(jì)算機(jī)端輸出端口 參數(shù): 無(wú)3.3 Setup(a,b,c,d,e,f,g)說(shuō)明: 設(shè)定卷標(biāo)的寬度
4、、高度、打印速度、打印濃度、感應(yīng)器類(lèi)別、gap/black mark 垂直間距、gap/black mark 偏移距離)參數(shù): a: 字符串型別,設(shè)定卷標(biāo)寬度,單位 mm b: 字符串型別,設(shè)定卷標(biāo)高度,單位 mm c: 字符串型別,設(shè)定打印速度,(打印速度隨機(jī)型不同而有不同的選項(xiàng)) 1.0: 每秒1.0吋打印速度 1.5: 每秒1.5吋打印速度 2.0: 每秒2.0吋打印速度 3.0: 每秒3.0吋打印速度 4.0: 每秒4.0吋打印速度 5.0: 每秒5.0吋打印速度 6.0: 每秒6.0吋打印速度 d: 字符串型別,設(shè)定打印濃度,015,數(shù)字愈大打印結(jié)果愈黑 e: 字符串型別,設(shè)定使用感
5、應(yīng)器類(lèi)別 0 表示使用垂直間距傳感器(gap sensor) 1 表示使用黑標(biāo)傳感器(black mark sensor) f: 字符串型別,設(shè)定gap/black mark 垂直間距高度,單位: mm g: 字符串型別,設(shè)定gap/black mark 偏移距離,單位: mm,此參數(shù)若 使用一般卷標(biāo)時(shí)均設(shè)為03.4 clearbuffer() 說(shuō)明: 清除 參數(shù): 無(wú)3.5 barcode(a,b,c,d,e,f,g,h,I) (1)說(shuō)明: 使用條形碼機(jī)內(nèi)建條形碼打印參數(shù): a: 字符串型別,條形碼X方向起始點(diǎn),以點(diǎn)(point)表示。 (200 DPI,1點(diǎn)=1/8 mm, 300 DPI
6、,1點(diǎn)=1/12 mm) b: 字符串型別,條形碼Y方向起始點(diǎn),以點(diǎn)(point)表示。 (200 DPI,1點(diǎn)=1/8 mm, 300 DPI,1點(diǎn)=1/12 mm) c: 字符串型別, 128 Code 128, switching code subset A, B, C automatically 128M Code 128, switching code subset A, B, C manually. EAN128 Code 128, switching code subset A, B, C automatically 25 Interleaved 2 of 5 25C Inter
7、leaved 2 of 5 with check digits 39 Code 39 39C Code 39 with check digits 93 Code 93EAN13 EAN 13EAN13+2 EAN 13 with 2 digits add-onEAN13+5 EAN 13 with 5 digits add-onEAN8 EAN 8 EAN8+2 EAN 8 with 2 digits add-onEAN8+5 EAN 8 with 5 digits add-onCODA CodabarPOST PostnetUPCA UPC-AUPCA+2 UPC-A with 2 digi
8、ts add-oUPCA+5 UPC-A with 5 digits add-onUPCE UPC-E UPCE+2 UPC-E with 2 digits add-onUPCE+5 UPC-E with 5 digits add-on3.5 barcode(a,b,c,d,e,f,g,h,I) (2)d: 字符串型別,設(shè)定條形碼高度,高度以點(diǎn)來(lái)表示e: 字符串型別,設(shè)定是否打印條形碼碼文 0: 不打印碼文 1: 打印碼文 f: 字符串型別,設(shè)定條形碼旋轉(zhuǎn)角度 0: 旋轉(zhuǎn)0度 90: 旋轉(zhuǎn)90度 180: 旋轉(zhuǎn)180度 270: 旋轉(zhuǎn)270度g: 字符串型別,設(shè)定條形碼寬窄bar 比例因子,請(qǐng)
9、參考TSPL使用手冊(cè)h: 字符串型別,設(shè)定條形碼寬窄bar 比例因子,請(qǐng)參考TSPL使用手冊(cè) I: 字符串型別,條形碼內(nèi)容3.5 barcode(a,b,c,d,e,f,g,h,I) (3)3.6 printerfont(a,b,c,d,e,f,g)說(shuō)明: 使用條形碼機(jī)內(nèi)建文字打印參數(shù): a: 字符串型別,文字X方向起始點(diǎn),以點(diǎn)(point)表示。 (200 DPI,1點(diǎn)=1/8 mm, 300 DPI,1點(diǎn)=1/12 mm) b: 字符串型別,文字Y方向起始點(diǎn),以點(diǎn)(point)表示。 (200 DPI,1點(diǎn)=1/8 mm, 300 DPI,1點(diǎn)=1/12 mm) c: 字符串型別,內(nèi)建字型
10、名稱(chēng),共12種。 1: 8*/12 2: 12*20 dots 3: 16*24 dots 4: 24*32 dots 5: 32*48 dots TST24.BF2: 繁體中文24*24 TST16.BF2: 繁體中文16*16 TTT24.BF2: 繁體中文24*24 (電信碼) TSS24.BF2: 簡(jiǎn)體中文24*24 TSS16.BF2: 簡(jiǎn)體中文16*16 K: 韓文 24*24 L: 韓文 16*16 d: 字符串型別,設(shè)定文字旋轉(zhuǎn)角度 0: 旋轉(zhuǎn)0度 90: 旋轉(zhuǎn)90度 180: 旋轉(zhuǎn)180度 270: 旋轉(zhuǎn)270度 e: 字符串型別,設(shè)定文字X方向放大倍率,18 f: 字符串型
11、別,設(shè)定文字Y方向放大倍率,18 g: 字串型別,列印文字內(nèi)容3.7 sendcommand(command)說(shuō)明: 送內(nèi)建指令到條形碼打印機(jī)參數(shù): 詳細(xì)指令請(qǐng)參考TSPL3.8 printlabel(a,b)說(shuō)明: 打印卷標(biāo)內(nèi)容參數(shù): a: 字符串型別,設(shè)定打印卷標(biāo)式數(shù)(set) b: 字符串型別,設(shè)定打印卷標(biāo)份數(shù)(copy)3.9 downloadpcx(a,b)說(shuō)明:下載單色PCX 格式圖文件至打印機(jī)參數(shù): a: 字符串型別,文件名(可包含路徑) b: 字符串型別,下載至打印機(jī)內(nèi)存內(nèi)之文件 名(請(qǐng)使用大寫(xiě)檔名)3.10 formfeed()說(shuō)明: 跳頁(yè),該函式需在setup后使用參數(shù):
12、無(wú)3.11 nobackfeed() 說(shuō)明: 設(shè)定紙張不回吐 參數(shù): 無(wú)3.12 windowsfont(a,b,c,d,e,f,g,h)說(shuō)明: 使用Windows TTF字型打印文字參數(shù): a: 整數(shù)型別,文字X方向起始點(diǎn),以點(diǎn)(point)表示。 b: 整數(shù)型別,文字Y方向起始點(diǎn),以點(diǎn)(point)表示。 c: 整數(shù)型別,字體高度,以點(diǎn)(point)表示。 d: 整數(shù)型別,旋轉(zhuǎn)角度,逆時(shí)鐘方向旋轉(zhuǎn) 0 - 0 degree 90- 90 degree 180- 180 degree 270- 270 degree e: 整數(shù)型別,字體外形 0- 標(biāo)準(zhǔn)(Normal) 1- 斜體(Itali
13、c) 2- 粗體(Bold) 3- 粗斜體(Bold and Italic) f: 整數(shù)型別, 底線(xiàn) 0- 無(wú)底線(xiàn) 1- 加底線(xiàn) g: 字符串型別,字體名稱(chēng)。 如: Arial, Times new Roman, 細(xì)名體, 標(biāo)楷體 h: 字符串型別,打印文字內(nèi)容。3.13 about()說(shuō)明: 顯示DLL 版本號(hào)碼參數(shù): 無(wú)4.1 引言 4 Visual Basic 5.0, 6.0 下TSC函式庫(kù)的應(yīng)用 Visual Basic(簡(jiǎn)稱(chēng)VB)是一種可視化的面向?qū)ο蟮木幊陶Z(yǔ)言,深受廣大Windows程序員的喜愛(ài)。但和任何其它語(yǔ)言一樣,VB并不能滿(mǎn)足所有的編程需要,例如沒(méi)有提供讀寫(xiě)硬件端口、控制中
14、斷等硬件控制函數(shù)。而在一些工業(yè)控制場(chǎng)合,往往需要對(duì)硬件板卡進(jìn)行讀寫(xiě)操作,如果控制軟件是采用VB編寫(xiě)的,就很有必要對(duì)其進(jìn)行功能擴(kuò)充,使其具有操作硬件的能力。因此,VB可以通過(guò)聲明和執(zhí)行DLL函數(shù)調(diào)用新硬件設(shè)備的DLL設(shè)備驅(qū)動(dòng)函數(shù) 。Private Declare Sub openport Lib c:windowssystemtsclib.dll (ByVal PrinterName As String)動(dòng)態(tài)庫(kù)的路徑定義參數(shù)類(lèi)型函數(shù)釋放用Visual Basic的Declare語(yǔ)句聲明要使用的DLL過(guò)程或數(shù);執(zhí)行DLL子程序。 例如:私有聲明4.2 VB調(diào)用DLL函數(shù)的步驟4.3 VB下的動(dòng)態(tài)庫(kù)
15、函數(shù)聲明(1)Private Declare Sub openport Lib c:windowssystemtsclib.dll (ByVal PrinterName As String)Private Declare Sub closeport Lib c:windowssystemtsclib.dll ()Private Declare Sub sendcommand Lib c:windowssystemtsclib.dll ( _ ByVal command As String)Private Declare Sub setup Lib c:windowssystemtsclib.d
16、ll ( _ ByVal LabelWidth As String, _ ByVal LabelHeight As String, _ ByVal Speed As String, _ ByVal Density As String, _ ByVal Sensor As String, _ ByVal Vertical As String, _ ByVal Offset As String)Private Declare Sub downloadpcx Lib c:windowssystemtsclib.dll ( _ ByVal Filename As String, _ ByVal Ima
17、geName As String)Private Declare Sub barcode Lib c:windowssystemtsclib.dll ( ByVal X As String, _ ByVal Y As String, _ ByVal CodeType As String, _ ByVal Height As String, _ ByVal Readable As String, _ ByVal rotation As String, _ ByVal Narrow As String, _ ByVal Wide As String, _ ByVal Code As String)
18、Private Declare Sub printerfont Lib c:windowssystemtsclib.dll (ByVal X As String, _ ByVal Y As String, _ ByVal FontName As String, _ ByVal rotation As String, _ ByVal Xmul As String, _ ByVal Ymul As String, _ ByVal Content As String)4.3 VB下的動(dòng)態(tài)庫(kù)函數(shù)聲明(2)4.3 VB下的動(dòng)態(tài)庫(kù)函數(shù)聲明(3)Private Declare Sub clearbuffer
19、 Lib c:windowssystemtsclib.dll ()Private Declare Sub printlabel Lib c:windowssystemtsclib.dll ( _ ByVal NumberOfSet As String, _ ByVal NumberOfCopy As String)Private Declare Sub formfeed Lib c:windowssystemtsclib.dll ()Private Declare Sub nobackfeed Lib c:windowssystemtsclib.dll ()Private Declare Su
20、b windowsfont Lib c:windowssystemtsclib.dll ( _ ByVal X As Integer, _ ByVal Y As Integer, _ ByVal fontheight As Integer, _ ByVal rotation As Integer, _ ByVal fontstyle As Integer, _ ByVal fontunderline As Integer, _ ByVal FaceName As String, _ ByVal TextContent As String)4.4 指令具體使用5 FoxPro下TSC函式庫(kù)的應(yīng)用
21、5.1 引言 FoxPro是基于WINDOWS操作系統(tǒng)下的一種數(shù)據(jù)庫(kù)編寫(xiě)軟件。現(xiàn)在比較盛行的是可視化的Visual FoxPro ,也簡(jiǎn)稱(chēng) FoxPro 。 由于它能夠運(yùn)行在更廉價(jià)的、舊的硬件上,運(yùn)行遺留下來(lái)的代碼,而且仍然能夠執(zhí)行現(xiàn)代的編程語(yǔ)言希望實(shí)現(xiàn)的事務(wù),它仍然是那些叛逆的組織、小型的資源有限的辦公室、獨(dú)立軟件開(kāi)發(fā)者以及很多政府和政府運(yùn)轉(zhuǎn)機(jī)構(gòu)的選擇。 5.2 FoxPro范例(1)declare openport in c:windowssystemtsclib.dll string declare closeport in c:windowssystemtsclib.dll decla
22、re sendcommand in c:windowssystemtsclib.dll declare setup in c:windowssystemtsclib.dll string,string,string,string,string,string,string declare downloadpcx in c:windowssystemtsclib.dll string, string declare barcode in c:windowssystemtsclib.dll string,string,string,string,string,string,string,string
23、,string declare printerfont in c:windowssystemtsclib.dll string,string,string,string,string,string,stringdeclare clearbuffer in c:windowssystemtsclib.dlldeclare printlabel in c:windowssystemtsclib.dll string,stringdeclare formfeed in c:windowssystemtsclib.dll declare nobackfeed in c:windowssystemtsc
24、lib.dlldeclare windowsfont in c:windowssystemtsclib.dllinteger,integer,integer,integer,integer,integer,integer,string,stringopenport(“TSC TTP-243 Plus”)setup(32,25,2,10,0,0,0)clearbuffer()barcode(10,0,EAN13,80,1,0,2,4,123456789012)windowsfont(10,100,50,0,0,0,標(biāo)楷體,標(biāo)楷體字型)printlabel(1,1)closeport()5.2 F
25、oxPro范例(2)8.6.1 引言6 Delphi下TSC函式庫(kù)的應(yīng)用 Delphi是著名的Borland(現(xiàn)在已和Inprise合并)公司開(kāi)發(fā)的可視化軟件開(kāi)發(fā)工具。 Delphi是一門(mén)真正的面向?qū)ο蟮拈_(kāi)發(fā)工具,并且是完全的可視化。 Delphi使用了真編譯,可以讓你的代碼編譯成為可執(zhí)行的文件,而且編譯速度非常快。 Delphi具有強(qiáng)大的數(shù)據(jù)庫(kù)開(kāi)發(fā)能力,可以讓你輕松地開(kāi)發(fā)數(shù)據(jù)庫(kù)。6.2 Delphi范例(1)procedure openport(PrinterName:pchar);stdcall;far; external tsclib.dll;procedure closeport; e
26、xternal tsclib.dll;procedure sendcommand(Command:pchar);stdcall;far;external tsclib.dll;procedure setup(LabelWidth, LabelHeight, Speed, Density, Sensor, Vertical, Offset:pchar);tsdcall; far; external tsclib.dll;procedure downloadpcx(Filename,ImageName:pchar);stdcall;far; external tsclib.dll;procedure barcode(X, Y, CodeType, Height, Readable, Rotation, Narrow, Wide, Code :pchar); stdcall; far; external tsclib.dll
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 煙道風(fēng)管施工方案
- 毛石棧道施工方案
- 2025至2030年中國(guó)仿絨面料數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 其他地區(qū)西藏林芝市發(fā)展和改革委員會(huì)救災(zāi)物資儲(chǔ)備中心招聘筆試歷年參考題庫(kù)附帶答案詳解
- 中醫(yī)健康服務(wù)中心建設(shè)可行性研究(僅供參考)
- 樓頂翻修施工方案
- 噴泉設(shè)備施工方案
- 麗水2025年浙江麗水市市直醫(yī)療衛(wèi)生健康單位招聘衛(wèi)技人員79人筆試歷年參考題庫(kù)附帶答案詳解
- 濮陽(yáng)深井施工方案
- 全國(guó)人教版初中信息技術(shù)七年級(jí)上冊(cè)第三單元第9課三、《編輯與修飾表格》教學(xué)設(shè)計(jì)
- 全科醫(yī)生的臨床帶教方法
- T-GMIAAC 004-2024 醫(yī)療建筑綜合能源管理規(guī)程
- 全國(guó)第三屆職業(yè)技能大賽(無(wú)人機(jī)駕駛(植保)項(xiàng)目)選拔賽理論考試題庫(kù)(含答案)
- 《AIGC與電商營(yíng)銷(xiāo)技能實(shí)戰(zhàn)(慕課版)》 教學(xué)大綱
- UL746A標(biāo)準(zhǔn)中文版-2019聚合材料短期性能評(píng)估第六版
- 危險(xiǎn)化學(xué)品目錄(2024版)
- 普法課件新編:2024年統(tǒng)計(jì)法詳解
- 2024年裝飾公司員工合同范本
- 患者床頭抬高
- 2024-2025學(xué)年第一學(xué)期高二教學(xué)質(zhì)量檢測(cè)歷史答案
- 2021年1月維修電工高級(jí)技師模擬試題及答案卷3
評(píng)論
0/150
提交評(píng)論