hardware interaction

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anant_tickoo@yahoo.com

    hardware interaction

    how to interact with printer port in c++ on NT based system?

    i want to send the data to printer port and also want to read from it
    but Nt system in not allowing me to do that.

    help needed for that

  • benben

    #2
    Re: hardware interaction

    > how to interact with printer port in c++ on NT based system?[color=blue]
    >
    > i want to send the data to printer port and also want to read from it
    > but Nt system in not allowing me to do that.
    >
    > help needed for that
    >[/color]

    I'm not quite sure but maybe you can try the following:

    std::string str = "hello";
    std::ofstream printer("LPT1") ;
    printer << str;

    Ben


    Comment

    • John Harrison

      #3
      Re: hardware interaction

      anant_tickoo@ya hoo.com wrote:[color=blue]
      > how to interact with printer port in c++ on NT based system?
      >
      > i want to send the data to printer port and also want to read from it
      > but Nt system in not allowing me to do that.
      >
      > help needed for that
      >[/color]

      C++ doesn't not define any interaction with hardware it is all
      abstracted through streams.

      For an answer that works for NT you need to ask in a Windows programming
      group, because this is really a Windows programming question not a C++
      question. Try news:comp.os.ms-windows.program mer.win32 for instance.

      john

      Comment

      Working...