G
Guest
Anyone uses MSComm in .net? I try to dynamically create the MSComm, without
dragging the control to the form, but got the InvalidActiveXStateException.
Dim cmp As AxMSCommLib.AxMSComm
cmp = New AxMSCommLib.AxMSComm
CType(Me.ScanSerial, System.ComponentModel.ISupportInitialize).BeginInit()
cmp.ContainingControl = Me
cmp.Enabled = True
cmp.Name = "Serial"
'cmp.OcxState =
CType(Me.ScanSerial, System.ComponentModel.ISupportInitialize).EndInit()
Any idea how to solve it or what causes the problem? Is the BeginInit() and
EndInit() needed?
thanks
eugene
dragging the control to the form, but got the InvalidActiveXStateException.
Dim cmp As AxMSCommLib.AxMSComm
cmp = New AxMSCommLib.AxMSComm
CType(Me.ScanSerial, System.ComponentModel.ISupportInitialize).BeginInit()
cmp.ContainingControl = Me
cmp.Enabled = True
cmp.Name = "Serial"
'cmp.OcxState =
CType(Me.ScanSerial, System.ComponentModel.ISupportInitialize).EndInit()
Any idea how to solve it or what causes the problem? Is the BeginInit() and
EndInit() needed?
thanks
eugene