bmatumbura
asked on
Referencing an MSComm Control from a Class
I have a class (CDevice) that should reference an MSComm Control (MSComm1) on a Form (Form1). The class has a public property (Device). In the Class it is declared as:
Private mvarDevice As MSComm
The class has the public property Set/Get methods for mvarDevice.
In Form1, I have the declaration:
Private WithEvents ODevice As CDevice.
In the Form_Load event, I have the statement:
Set ODevice = New CDevice
In CDevice Class Initialize event, I have the statement:
Set mvarDevice = Form1.MSComm1
My problem is I get an error in the above statement. VB reports an error indicating the events for MSComm1 do not match... something. I'll post the actual error message.
What could be the problem. At the moment I am not using the mvarDevice reference to reference MSComm1 on Form1 because of this error. I am using Form1.MSComm1... in the class to reference the MSComm Control.
Private mvarDevice As MSComm
The class has the public property Set/Get methods for mvarDevice.
In Form1, I have the declaration:
Private WithEvents ODevice As CDevice.
In the Form_Load event, I have the statement:
Set ODevice = New CDevice
In CDevice Class Initialize event, I have the statement:
Set mvarDevice = Form1.MSComm1
My problem is I get an error in the above statement. VB reports an error indicating the events for MSComm1 do not match... something. I'll post the actual error message.
What could be the problem. At the moment I am not using the mvarDevice reference to reference MSComm1 on Form1 because of this error. I am using Form1.MSComm1... in the class to reference the MSComm Control.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.