If you try to open the serial port with Microsoft Comm Control, you may receive the following error message:
Run-time error '8015': Could not set comm state, there may be one or more invalid communications parameters.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
Private Declare Function DefineDosDevice Lib "kernel32" Alias _
"DefineDosDeviceA" (ByVal dwFlags As Long, ByVal lpDeviceName _
As String, ByVal lpTargetPath As String) As Long
Const DDD_RAW_TARGET_PATH = &H1
DefineDosDevice DDD_RAW_TARGET_PATH, "COM5", "\Device\Serial0"
MSComm1.CommPort = 5
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.Handshaking = comNone
MSComm1.InBufferSize = 1024
MSComm1.OutBufferSize = 512
MSComm1.RThreshold = 0
MSComm1.SThreshold = 0
MSComm1.InputLen = 0
MSComm1.PortOpen = True
Keywords: kberrmsg, kbmodem, kbprb, kbserial, kb