CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Location
    Germany
    Posts
    20

    receiving data from lpt1?

    Hi,

    some printer ESC-sequences produce an answer giving back some bytes, for example when I want to check the status of a paper sensor. But how can I read this? I do the communication with CreateFile and WriteFile. But a subsequent ReadFile always reads 0 bytes.

    Any ideas?

    Thanks,

    Christian.

  2. #2
    Join Date
    Apr 2002
    Location
    St.Petersburg, Russia
    Posts
    714
    Are you using overlapped i/o? Is FILE_FLAG_OVERLAPPED specified while you are opening port?
    If no, try it. It should solve problem. But don't forget that in this case ReadFile() will return immediately and system performs read by itself. You can determine when reading process is finished by using the GetOverlappedResult() function.
    With best wishes, Alexander Hritonenkov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured