就是我用VB调条形码打印机的DLL,可以打印,但是我点右边的关闭时就会出现,内存错,不知道为什么?

解决方案 »

  1.   

    这个是模块声明:
    Declare Function OperatorPort Lib "TSC_Print_Lib.dll" (ByVal APrinterName As String) As String
    Declare Function ClearPort Lib "TSC_Print_Lib.dll" () As String
    Declare Function ExecCommand Lib "TSC_Print_Lib.dll" (ByVal ACommand As String) As String
    Declare Function InitLabel Lib "TSC_Print_Lib.dll" (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) As String
    Declare Function LoadPCx Lib "TSC_Print_Lib.dll" (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) As String
    Declare Function ExportFont Lib "TSC_Print_Lib.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) As String
    Declare Function ExportCode Lib "TSC_Print_Lib.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) As String
    Declare Function Clearbuf Lib "TSC_Print_Lib.dll" () As String
    Declare Function ExportLabel Lib "TSC_Print_Lib.dll" (ByVal numberofset As String, ByVal numberofcopoy As String) As String
    Declare Function FormFeedEx Lib "TSC_Print_Lib.dll" () As String
    Declare Function NobackFeedEx Lib "TSC_Print_Lib.dll" () As String
    Declare Function ScreenFont Lib "TSC_Print_Lib.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 textcontect As String) As String功能实现:
    Private Sub Command1_Click()
    ma.OperatorPort "TSC TTP/TDP-342(M)"
    ma.InitLabel CStr(50), CStr(40), CStr(4), CStr(8), CStr(0), CStr(1), CStr(0)
    ma.Clearbuf
    ma.ScreenFont 10, 10, 30, 0, 2, 0, "宋体", "abcde"
    ma.ExportCode "10", "10", "128", "28", "1", "0", "2", "2", "123456"
    ma.ExportLabel CStr(1), CStr(1)
    ma.Clearbuf
    ma.ClearPort
    End Sub大家看一下,为什么会出现错
      

  2.   

    Private Sub Form_Unload(Cancel As Integer)
        1.END   2.Unload Me  3.Unload me 
                               END
    End Sub试试不用end而用unload me结束程序会怎样三种方式都试一下
      

  3.   

    这三种都没有用的,是DLL的问题!!
      

  4.   

    可能在使用上有问题或者DLL本身有问题。