| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1910 人关注过本帖
标题:有谁用vfp控制北洋BTP2200E
只看楼主 加入收藏
sostemp
Rank: 4
等 级:贵宾
威 望:10
帖 子:202
专家分:284
注 册:2009-6-2
结帖率:80%
收藏
已结贴  问题点数:20 回复次数:3 
有谁用vfp控制北洋BTP2200E
BTP2200E.rar (1.64 MB)

有谁用vfp控制北洋BTP2200E,用BPLADLL.dll来打印条码与文字,thanks.

纸张:不干胶纸 单个宽50mm,高25mm 两列标签间距为2mm,竖向3mm间距

谢谢。

[此贴子已经被作者于2018-6-5 08:55编辑过]

搜索更多相关主题的帖子: vfp 控制 单个 两列 间距 
2018-06-01 16:05
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10609
专家分:43210
注 册:2014-5-20
收藏
得分:10 
参考文档的手册和VB的示例,用VFP代码应该可以。
2018-06-01 16:40
sostemp
Rank: 4
等 级:贵宾
威 望:10
帖 子:202
专家分:284
注 册:2009-6-2
收藏
得分:0 
Attribute VB_Name = "BPLADLL"
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Declare Function GetTickCount Lib "kernel32" () As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)



'''port type

Public Const PORT_SERIAL As Long = 1
Public Const PORT_PARALLEL As Long = 2
Public Const PORT_USBDEVICE As Long = 3
Public Const PORT_ETHERNET As Long = 4
Public Const PORT_DRIVER As Long = 5


   
'''code of return value

Public Const SDK_SUCCESS As Long = 0
Public Const ERR_HANDLE As Long = -1
Public Const ERR_PARAMETER As Long = -2
Public Const ERR_APIFUNCTION As Long = -3
Public Const ERR_TIMEOUT As Long = -4
Public Const ERR_OPENFILE As Long = -5
Public Const ERR_READFILE As Long = -6
Public Const ERR_WRITEFILE As Long = -7
Public Const ERR_OUTBOUND As Long = -8
Public Const ERR_LOADDLLFILE As Long = -9
Public Const ERR_LOADDLLFUNCTION As Long = -10
Public Const ERR_DOWNLOADFILECLASH As Long = -11
Public Const ERR_DOWNLOADFILE As Long = -12
Public Const ERR_NOFLASH As Long = -13
Public Const ERR_NORAM As Long = -14
Public Const ERR_IMAGETYPE As Long = -15
Public Const ERR_BARCODE_PERCENTAGE As Long = -16
Public Const ERR_BARCODE_CHARACTEROUT As Long = -17
Public Const ERR_NOTSUPPORT As Long = -18
Public Const ERR_NOFILENAME As Long = -19
Public Const ERR_BUFFERERROR As Long = -20


'''label printing commands

Public Const PRINT_LINE As Long = 1
Public Const PRINT_BOX As Long = 2
Public Const PRINT_CIRCLE As Long = 3
Public Const PRINT_INNERFONT As Long = 4
Public Const PRINT_DOWNLOADINGFONT As Long = 5
Public Const PRINT_MIXFONT As Long = 6
Public Const PRINT_CODE_39 As Long = 7
Public Const PRINT_CODE_UPCA As Long = 8
Public Const PRINT_CODE_UPCE As Long = 9
Public Const PRINT_CODE_NOVERIFY25 As Long = 10
Public Const PRINT_CODE_128 As Long = 11
Public Const PRINT_CODE_ENA13 As Long = 12
Public Const PRINT_CODE_ENA8 As Long = 13
Public Const PRINT_CODE_HBIC As Long = 14
Public Const PRINT_CODE_CODABAR As Long = 15
Public Const PRINT_CODE_VERIFY25 As Long = 16
Public Const PRINT_CODE_INDUSTRY25 As Long = 17
Public Const PRINT_CODE_TRANSPORT As Long = 18
Public Const PRINT_CODE_UPC2 As Long = 19
Public Const PRINT_CODE_UPC5 As Long = 20
Public Const PRINT_CODE_93 As Long = 21
Public Const PRINT_CODE_POSTNET As Long = 22
Public Const PRINT_CODE_UCCENA As Long = 23
Public Const PRINT_CODE_EUROPE25 As Long = 24
Public Const PRINT_CODE_JAPAN25 As Long = 25
Public Const PRINT_CODE_CHINA25 As Long = 26
Public Const PRINT_PDF As Long = 27
Public Const PRINT_QR As Long = 28
Public Const PRINT_MAXI As Long = 29
Public Const PRINT_IMAGE As Long = 30
Public Const PRINT_DOWNLOADINGIMAGE As Long = 31
Public Const PRINT_GRAYIMAGE As Long = 32
Public Const PRINT_TREUTYPE As Long = 33
Public Const PRINT_GM As Long = 34

'''struct define

Public Type COMPara
    cPortName(31) As Byte
    iBaudrate As Long
    iDataBits As Long
    iStopBits As Long
    iParity As Long
    iFlowControl As Long
    iCheckEnable As Long
    iCheckTimeout As Long
End Type


Public Type LPTPara
    cPortName(31) As Byte
End Type


Public Type NetPara
    cIPAddr(39) As Byte
    iNetPort As Long
End Type


Public Type DrvPara
    cDrvName(63) As Byte
End Type


Public Type USBPara
    iUSBMode As Long
    iDevID As Long
    cDevName(63) As Byte
End Type


Public Type BasePara
    iDPI As Long
    iUnit As Long
    iOutMode As Long
    iPaperType As Long
    iPrintMode As Long
    iAllRotateMode As Long
    iAllMirror As Long
End Type


Public Type LinePrintPara
    iStartX As Long
    iStartY As Long
    iEndX As Long
    iEndY As Long
    iLineWidth As Long
End Type


Public Type BoxPrintPara
    iStartX As Long
    iStartY As Long
    iWidth As Long
    iHeight As Long
    iHorizontal As Long
    iVertical As Long
End Type


Public Type CirclePrintPara
    iCenterX As Long
    iCenterY As Long
    iRadius As Long
    iLineWidth As Long
End Type


Public Type DownLoadingImagePrintPara
    cImageName(7) As Byte
    iStartX As Long
    iStartY As Long
    iPointWidth As Long
    iPointHeight As Long
End Type


Public Type ImagePrintPara
    cImageName(255) As Byte
    iStartX As Long
    iStartY As Long
End Type


Public Type InnerFontPrintPara
    cTextData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iFontType As Long
    iWidthMultiple As Long
    iHeightMultiple As Long
    iSpace As Long
    iMirrorEnable As Long
End Type


Public Type DownloadingFontPrintPara
    cText As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    cFontName(19) As Byte
    iWidthMultiple As Long
    iHeightMultiple As Long
    iSpace As Long
    iMirrorEnable As Long
End Type


Public Type MixFontPrintPara
    cText As String
    iStartX As Long
    iCN_StartY As Long
    iXY_Adjust As Long
    iRotate As Long
    cEN_FontType(19) As Byte
    cCN_FontName(19) As Byte
    iWidthMultiple As Long
    iHeightMultiple As Long
    iSpace As Long
    iMirrorEnable As Long
End Type


Public Type TruetypePrintPara
    cText As String
    iStartX As Long
    iStartY As Long
    cFontName(99) As Byte
    iFontHeight As Long
    iFontWidth As Long
    iRotate As Long
    iBold As Long
    iItalic As Long
    iUnderline As Long
End Type


Public Type Code39PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeUPCAPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeUPCEPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type NoVerify25CodePrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type Code128PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeEna13PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeEna8PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeHBICPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodaBarPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeVerify25PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeIndustry25PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeTransportPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeUPC2PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeUPC5PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type

Public Type Code93PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodePOSTNETPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeUCCENAPrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumberBase As Long
End Type


Public Type CodeEurope25PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeJapan25PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type CodeChina25PrintPara
    cCodeData As String
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iType As Long
    iHeight As Long
    iNumber As Long
    iNumberBase As Long
End Type


Public Type PDFPrintPara
    cCodeData As String
    iDataLen As Long
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iBaseWidth As Long
    iBaseHeight As Long
    iScaleWidth As Long
    iScaleHeight As Long
    iRow As Long
    iColumn As Long
    iCutMode As Long
    iLeve As Long
    iDataMode As Long
End Type


Public Type QRPrintPara
    cCodeData As String
    iDataLen As Long
    iStartX As Long
    iStartY As Long
    iWeigth As Long
    iSymbolType As Long
    iLanguageMode As Long
End Type


Public Type MAXIPrintPara
    cCodeData As String
    iDataLen As Long
    iStartX As Long
    iStartY As Long
End Type
   
   
Public Type GMPrintPara
    cCodeData As String
    iDataLen As Long
    iStartX As Long
    iStartY As Long
    iRotate As Long
    iLevel As Long
    iWidth As Long
    iHeight As Long
End Type
   
   
Public Type GrayImagePrintPara
    cImageFileName(255) As Byte
    iGrayMode As Long
End Type


'''function define

Public Declare Function Enum_DeviceNameList Lib "bpladll.dll" (ByVal iOperationType As Long, ByRef cDevNameBuf As Byte, ByVal iBufLen As Long, ByRef iNumber As Long, ByVal cFilterInfor As String) As Long

Public Declare Function Comm_OpenPort Lib "bpladll.dll" (ByVal iPortType As Long, vPortPara As Any, ByVal iPortParaStructLen As Long, ByVal iSaveFileEnable As Long, ByVal cFileName As String) As Long

Public Declare Function Comm_ClosePort Lib "bpladll.dll" (ByVal hDev As Long) As Long

Public Declare Function Comm_WritePort Lib "bpladll.dll" (ByVal hDev As Long, ByRef cBuf As Byte, ByVal iBufLen As Long, ByRef iReturnLen As Long) As Long

Public Declare Function Comm_ReadPort Lib "bpladll.dll" (ByVal hDev As Long, ByRef cBuf As Byte, ByVal iBufLen As Long, ByRef iReturnLen As Long) As Long

Public Declare Function Comm_SetPortTimeout Lib "bpladll.dll" (ByVal hDev As Long, ByVal iWriteTimeout As Long, ByVal iReadTimeout As Long) As Long

Public Declare Function Comm_SendFile Lib "bpladll.dll" (ByVal hDev As Long, ByVal cFileName As String) As Long

Public Declare Function Comm_DrvDocOperation Lib "bpladll.dll" (ByVal hDev As Long, ByVal iOperation As Long) As Long

Public Declare Function Ctrl_DevControl Lib "bpladll.dll" (ByVal hDev As Long, ByVal iOperationID As Long) As Long

Public Declare Function Ctrl_DownLoadImage Lib "bpladll.dll" (ByVal hDev As Long, ByVal cImageName As String, ByVal iImageType As Long, ByVal iModuleType As Long, ByVal cFileName As String, ByVal iCheckTimeout As Long) As Long

Public Declare Function Ctrl_EraseModuleAndFile Lib "bpladll.dll" (ByVal hDev As Long, ByVal iEraseMode As Long, ByVal iModuleType As Long, ByVal iFileType As Long, ByVal cFileName As String, ByVal iWaitTimeout As Long) As Long

Public Declare Function Ctrl_FeedAndBack Lib "bpladll.dll" (ByVal hDev As Long, ByVal iDistance As Long, ByVal iDelayTime As Long) As Long

Public Declare Function Get_VersionInfo Lib "bpladll.dll" (ByVal hDev As Long, ByVal cVersionInfo As String, ByVal iInfoLength As Long, ByRef iInfoTrueLen As Long, ByVal iCheckTimeout As Long) As Long

Public Declare Function Get_StatusData Lib "bpladll.dll" (ByVal hDev As Long, ByRef cStatusBuf As Byte, ByVal iStatusBufLen As Long, ByRef iStatusDataLen As Long, ByVal iTimeout As Long) As Long

Public Declare Function Set_BasePara Lib "bpladll.dll" (ByVal hDev As Long, ByRef sBasePara As BasePara, ByVal iStructLen As Long) As Long

Public Declare Function Set_OutPosition Lib "bpladll.dll" (ByVal hDev As Long, ByVal iPosition As Long) As Long

Public Declare Function Set_PaperLength Lib "bpladll.dll" (ByVal hDev As Long, ByVal iContinueLength As Long) As Long

Public Declare Function Set_WaterMarkMode Lib "bpladll.dll" (ByVal hDev As Long, ByVal iLayoutMode As Long, ByVal cFileName As String, ByVal iCheckTimeout As Long) As Long

Public Declare Function Set_HorizontalCopy Lib "bpladll.dll" (ByVal hDev As Long, ByVal iPieces As Long, ByVal iGap As Long) As Long

Public Declare Function Prt_LabelToMemory Lib "bpladll.dll" (ByVal hDev As Long) As Long

Public Declare Function Prt_MemoryLabel Lib "bpladll.dll" (ByVal hDev As Long, ByVal iPieces As Long) As Long

Public Declare Function Prt_EnterLabelMode Lib "bpladll.dll" (ByVal hDev As Long, ByVal iGrayModeEnable As Long, ByVal iWidth As Long, ByVal iColumn As Long, ByVal iRow As Long, ByVal iSpeed As Long, ByVal iDarkness As Long) As Long

Public Declare Function Prt_EndLabelAndPrint Lib "bpladll.dll" (ByVal hDev As Long, ByVal iTotalNum As Long, ByVal iSameNum As Long, ByVal iOutUnit As Long) As Long

Public Declare Function Prt_LastFieldSetting Lib "bpladll.dll" (ByVal hDev As Long, ByVal cDataBuf As String, ByVal iDataLength As Long, ByVal cFileEnter As String, ByVal iFieldStartPoint As Long, ByVal iFieldLength As Long) As Long

Public Declare Function Prt_LabelPrintSetting Lib "bpladll.dll" (ByVal hDev As Long, ByVal iSettingCommand As Long, ByRef vParaSetting As Any, ByVal iStructLen As Long, ByVal iBitMode As Long) As Long

2018-06-05 08:55
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:10 
楼主将那么长的代码贴出来,可能没有几个人会有耐心逐行看完这些代码。打印条码的方式很多,我是参照FoxBarCode的算法,然后通过绘图方式来绘制代码,简捷方便。绘制图形的代码我在本坛发过,算法的代码怕引起行版权纠纷没有发。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2018-06-06 08:47
快速回复:有谁用vfp控制北洋BTP2200E
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.044256 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved