Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
I

iir

@iir
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Is it impossible to use IOCP for consoles ?
    I iir

    At the first time I tried to use GetStdHandle but IOCP was not created. So I tried to use CreateFile to supply FILE_FLAG_OVERLAPPED for the console handle. Finally I concluded that IOCP cannot be used for console I/O.

    C / C++ / MFC help question

  • Is it impossible to use IOCP for consoles ?
    I iir

    Though I supply non-zero value for the completion key ( the 3rd arg. ), the result is the same. And I couldn't find restrictions for the value of the completion key mentioned in MSDN. And supplying INVALID_HANDLE_VALUE for the 1st arg is not compatible for NT 3.5 or below.

    C / C++ / MFC help question

  • Is it impossible to use IOCP for consoles ?
    I iir

    In the following short program, CreateIoCompletionPort fails and GetLastError says invalid handle was supplied. Return values from CreateFile is not INVALID_HANDLE_VALUE so I guess that IOCP doesn't accept handles for consoles. I just want to confirm that it is true or I made a mistake in this program. I intended to receive console inputs via IOCP. #include #include int main( void ) { HANDLE stdin_handle, iocp, stdout_handle; stdin_handle = CreateFile( "CON", GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL ); stdout_handle = CreateFile( "CON", GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL ); iocp = CreateIoCompletionPort( stdin_handle, NULL, 0, 1 ); if( iocp ) { CloseHandle( iocp ); puts( "O.K." ); } else { printf( "Error = %lu, stdin=%p, stdout=%p invalid_handle=%p\n", GetLastError(), stdin_handle, stdout_handle, INVALID_HANDLE_VALUE ); } return 0; } -- modified at 4:02 Tuesday 10th January, 2006

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups