Mscomm control in VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Barry

    Mscomm control in VB.NET

    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.outpu t = "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

  • Herfried K. Wagner [MVP]

    #2
    Re: Mscomm control in VB.NET

    * "Barry" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
    > 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.outpu t = "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[/color]

    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.

    --
    Herfried K. Wagner [MVP]
    <http://www.mvps.org/dotnet>

    Comment

    Working...