Steven McDonald
Well-known member
I'm getting an InvalidActiveXStateException. This is the code I used.
Apparently this error is thrown when the variable MSComm2 isn't instantiated properly or initialized properly.
Any Help would be gr8
Apparently this error is thrown when the variable MSComm2 isn't instantiated properly or initialized properly.
Any Help would be gr8
VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] MSComm2 [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] AxMSCommLib.AxMSComm
[/size][size=2][color=#0000ff]If[/color][/size][size=2] iPortNumber <> 0 [/size][size=2][color=#0000ff]Then
[/color][/size][size=2]MSComm2.Settings = "9600,n,8,1"
MSComm2.CommPort = iPortNumber
MSComm2.PortOpen = [/size][size=2][color=#0000ff]True
[/color][/size][size=2]MSComm2.RThreshold = 1
MSComm2.Refresh()
MSComm2.Output = "/read card" & Chr(10)
iAccountNum = 0
[/size][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]If
[/color][/size][size=2]MSComm2.Dispose()
[/size]