After I installed the printer driver. I coudnt use MScomm control to send data to customer display. After that I create a virtual comm port com5 and send data to customer display by following code.
The form contain a comm control , name=MScomm1, CommPort=5
Code:
Public Sub disInCusDis(disStr As String)
DefineDosDevice DDD_RAW_TARGET_PATH, "COM5", "\Device\Serial0"
'defining a virtual com port with name com5
'the reason is that i coudnt open com1.Because the driver took that
MSComm1.PortOpen = True
MSComm1.Output = Chr(27) + "=" + Chr(2) 'for display, dont mesh up
' with this .this is not vb
MSComm1.Output = Chr(27) & "@" ' To clear display
MSComm1.Output = disStr
MSComm1.Output = Chr(27) + "=" + Chr(1) 'to bypass customer dis
MSComm1.PortOpen = False
DefineDosDevice DDD_RAW_TARGET_PATH, "COM1", "\Device\Serial0"
'now driver has com1 port
End Sub
Public Sub printByPosPrint(prntStr As String)
Printer.Print prntStr
Printer.EndDoc
end sub
How can I stop?
I think that when i redefine the "\Device\Serial0" The windows lost the control and send all the data that has.
If any one have any idea pls tell me.
