Printing directly to LPT/COM

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

    Printing directly to LPT/COM

    I have this in VB6

    Open "lpt1" For Output As #1
    Print #1, "abc"
    Close (1)

    How to do this in VB.NET? I am trying with FileOpen but it doesnt work. Can
    anyone help?

    Thanks


  • Dick Grier

    #2
    Re: Printing directly to LPT/COM

    Hi,

    There are a couple of ways.

    You can download IONet.dll from my homepage (a device driver wrapper that
    allows direct access to physical LPT ports, but not virtual ones, such as
    USB), or: http://support.microsoft.com/kb/322090/en-us

    Dick

    --
    Richard Grier, MVP
    Hard & Software
    Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
    Edition,
    ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
    2006.
    See www.hardandsoftware.net for details and contact information.


    Comment

    • MikeD

      #3
      Re: Printing directly to LPT/COM


      "Tony" <tony.m2@gmail. comwrote in message
      news:g2qonq$jlt $1@sunce.iskon. hr...
      >I have this in VB6
      >
      Open "lpt1" For Output As #1
      Print #1, "abc"
      Close (1)
      >
      How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
      Can anyone help?

      You're best off asking this in a dotnet newsgroup.

      --
      Mike
      Microsoft MVP Visual Basic


      Comment

      • MikeD

        #4
        Re: Printing directly to LPT/COM


        "MikeD" <nobody@nowhere .eduwrote in message
        news:eXOHkjOzIH A.4876@TK2MSFTN GP04.phx.gbl...
        >
        "Tony" <tony.m2@gmail. comwrote in message
        news:g2qonq$jlt $1@sunce.iskon. hr...
        >>I have this in VB6
        >>
        > Open "lpt1" For Output As #1
        > Print #1, "abc"
        > Close (1)
        >>
        >How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
        >Can anyone help?
        >
        >
        You're best off asking this in a dotnet newsgroup.

        Duh! I now see you did crosspost to a dotnet newsgroup. For the record, the
        microsoft.publi c.vb.* newsgroups are for VB6 and earlier. In the future,
        please don't include them in crossposts for dotnet-related questions.
        Thanks!

        --
        Mike
        Microsoft MVP Visual Basic


        Comment

        • steve907

          #5
          Re: Printing directly to LPT/COM

          On Jun 12, 7:20 pm, "MikeD" <nob...@nowhere .eduwrote:
          "MikeD" <nob...@nowhere .eduwrote in message
          >
          news:eXOHkjOzIH A.4876@TK2MSFTN GP04.phx.gbl...
          >
          >
          >
          "Tony" <tony...@gmail. comwrote in message
          news:g2qonq$jlt $1@sunce.iskon. hr...
          >I have this in VB6
          >
          Open "lpt1" For Output As #1
          Print #1, "abc"
          Close (1)
          >
          How to do this in VB.NET? I am trying with FileOpen but it doesnt work.
          Can anyone help?
          >
          You're best off asking this in a dotnet newsgroup.
          >
          Duh! I now see you did crosspost to a dotnet newsgroup. For the record, the
          microsoft.publi c.vb.* newsgroups are for VB6 and earlier. In the future,
          please don't include them in crossposts for dotnet-related questions.
          Thanks!
          >
          --
          Mike
          Microsoft MVP Visual Basic
          Now I'm confused. Isn't this a dotnet newsgroup?

          Comment

          • Jim Mack

            #6
            Re: Printing directly to LPT/COM

            steve907 wrote:
            On Jun 12, 7:20 pm, "MikeD" <nob...@nowhere .eduwrote:
            >"MikeD" <nob...@nowhere .eduwrote in message
            >>
            >news:eXOHkjOzI HA.4876@TK2MSFT NGP04.phx.gbl.. .
            >>
            >>
            >>
            >>"Tony" <tony...@gmail. comwrote in message
            >>news:g2qonq$j lt$1@sunce.isko n.hr...
            >>>I have this in VB6
            >>
            >>> Open "lpt1" For Output As #1
            >>> Print #1, "abc"
            >>> Close (1)
            >>
            >>>How to do this in VB.NET? I am trying with FileOpen but it
            >>>doesnt work. Can anyone help?
            >>
            >>You're best off asking this in a dotnet newsgroup.
            >>
            >Duh! I now see you did crosspost to a dotnet newsgroup. For the
            >record, the microsoft.publi c.vb.* newsgroups are for VB6 and
            >earlier. In the future, please don't include them in crossposts
            >for dotnet-related questions. Thanks!
            >>
            >--
            >Mike
            >Microsoft MVP Visual Basic
            >
            Now I'm confused. Isn't this a dotnet newsgroup?
            There is no "this", there's a "these" -- two incompatible groups.

            The OP cross-posted to two NGs. Groups with "dotnet" in their names
            are indeed for dotnet. Groups with just ".public.vb ." in their names
            are not. Hence the confusion.

            Just to clarify: microsoft.publi c.vb.winapi is NOT a dotnet group.

            --
            Jim

            Comment

            Working...