Withevents an MsComm
Posted on 1999-07-12
Is it possible to write a class using the MsComm control. I have written a skeleton of some code which doesn't seem to work - no errors but no action
Steps I have taken so far
1. Created a class called gps
2. Set a reference to mscomm32.ocx
3. added to the gps class;
Private WithEvents oncom As MSCommLib.MSComm
4. In the gps class Initialization;
Set oncom = New MSCommLib.MSComm
5. in the oncom_OnComm event put some code to read from the commport and do stuff.
6. Created a form and declared in the Load event
Dim cGps As New gps
cGps.openport = True
Putting a breakpoint in the oncomm_OnComm never gets fired.
Am I being optomistic trying to do this? The point of the class is to tuck everthing away without having to have a form with the MsComm control on it.