Mscomm control in VB.NET

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
 
H

Herfried K. Wagner [MVP]

* "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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top