This is the error:
View attachment 85217
Loaded Libraries:
View attachment 85218
Ther error is generated at Line 47 and is : pt.connectusb2(vid,pid)
This is the code:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger: True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim pt As printdemo
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
pt.initialize
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Dim vid As Int
Dim pid As Int
vid=0x4B8
pid=0xE15
pt.connectusb2(vid,pid) '<-- This is the statment that generates the error
End Sub
Sub Button2_Click
pt.printstr("UNDER IS PICTURE")
pt.printtest 'TEST PAPER
End Sub
Sub Button3_Click
Dim pic As Bitmap
pic.Initialize(File.DirAssets,"look.bmp")
pt.printstr("UNDER IS PICTURE")
pt.Print_BMP2(pt.POSPrintBMP(pic,300,0)) '(PICTURE,PAPER WIDTH,0)
Sleep(1000)
pt.cut 'CUT PAPAR
pt.Printbeep 'VOICE BEEP
End Sub