Mscomm control in VB.NET

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

I am using the mscomm activex control in vb.net. I can
add the control to the toolbar which will allow me to
drop it onto a form. As long as I am in the code space
for that form it works fine. When I try to output some
text to the serial port via AxMscomm1.output = "some
text" within a code module, the compiler says that
AxMscomm1 is not defined. Can anyone tell me how I pass a
reference to the mscomm control located on one form from
within a code module. I know I need to pass a reference
to the control but I need to know exactly how that is
accomplished.
Thanks,
Barry
 
* "Barry said:
I am using the mscomm activex control in vb.net. I can
add the control to the toolbar which will allow me to
drop it onto a form. As long as I am in the code space
for that form it works fine. When I try to output some
text to the serial port via AxMscomm1.output = "some
text" within a code module, the compiler says that
AxMscomm1 is not defined. Can anyone tell me how I pass a
reference to the mscomm control located on one form from
within a code module. I know I need to pass a reference
to the control but I need to know exactly how that is

You will have to pass a reference to the control to the module, for
example in a public property in the module which is set to the instance
of the MSComm control before calling the procedure or in a parameter of
the procedure.
 
Back
Top