I'am a beginner in Visual Basic 6.0. Now I try to write a ActiveX control
that is in charge of communication through COM1. So I decided to adopt
MSComm control.
I draged a button onto the usercontrol.Then I wrote some statements in
its double-click event handler,like this:
Private Sub Command1_Click()
Dim MyComm As MSComm
MyComm.CommPort = 1
MyComm.Settings = "9600,N,8,1"
MyComm.PortOpen = True
End Sub
Then I started to run it in a web page by printing F5. When I double-clicked
the button, a message box jumped out on which it says as following:
Run-time error '91':
Object variable or With block variable not set
Please tell me why this happened? Where did I wrote incorrectly? Thank all
of you!
Adrian
Chen