Click here to Skip to main content
15,888,073 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MDI application Pin
Rage10-Jan-06 0:21
professionalRage10-Jan-06 0:21 
GeneralRe: MDI application Pin
toxcct10-Jan-06 0:26
toxcct10-Jan-06 0:26 
GeneralOT... Pin
toxcct10-Jan-06 4:28
toxcct10-Jan-06 4:28 
AnswerRe: MDI application Pin
Yuwraj9-Jan-06 22:56
Yuwraj9-Jan-06 22:56 
AnswerRe: MDI application Pin
Curtis Schlak.10-Jan-06 4:15
Curtis Schlak.10-Jan-06 4:15 
QuestionI got following error while compiling.... Pin
Yuwraj9-Jan-06 22:19
Yuwraj9-Jan-06 22:19 
AnswerRe: I got following error while compiling.... Pin
toxcct9-Jan-06 22:27
toxcct9-Jan-06 22:27 
QuestionIs it impossible to use IOCP for consoles ? Pin
iir9-Jan-06 22:00
iir9-Jan-06 22:00 
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 <stdio.h>
#include <windows.h>

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
AnswerRe: Is it impossible to use IOCP for consoles ? Pin
__yb10-Jan-06 11:59
__yb10-Jan-06 11:59 
GeneralRe: Is it impossible to use IOCP for consoles ? Pin
iir10-Jan-06 13:36
iir10-Jan-06 13:36 
GeneralRe: Is it impossible to use IOCP for consoles ? Pin
__yb11-Jan-06 11:26
__yb11-Jan-06 11:26 
GeneralRe: Is it impossible to use IOCP for consoles ? Pin
iir11-Jan-06 18:28
iir11-Jan-06 18:28 
GeneralRe: Is it impossible to use IOCP for consoles ? Pin
__yb12-Jan-06 5:57
__yb12-Jan-06 5:57 
QuestionAbout using WMP10 in MFC Pin
StarMeteor9-Jan-06 21:37
StarMeteor9-Jan-06 21:37 
QuestionHow to change UUID? Pin
<color>Aljechin 9-Jan-06 21:30
<color>Aljechin 9-Jan-06 21:30 
AnswerRe: How to change UUID? Pin
Rage9-Jan-06 21:36
professionalRage9-Jan-06 21:36 
GeneralRe: How to change UUID? Pin
<color>Aljechin 9-Jan-06 21:41
<color>Aljechin 9-Jan-06 21:41 
GeneralRe: How to change UUID? Pin
Bob Stanneveld9-Jan-06 22:47
Bob Stanneveld9-Jan-06 22:47 
GeneralRe: How to change UUID? Pin
<color>Aljechin 9-Jan-06 23:07
<color>Aljechin 9-Jan-06 23:07 
GeneralRe: How to change UUID? Pin
Bob Stanneveld9-Jan-06 23:59
Bob Stanneveld9-Jan-06 23:59 
GeneralRe: How to change UUID? Pin
<color>Aljechin 10-Jan-06 1:09
<color>Aljechin 10-Jan-06 1:09 
GeneralRe: How to change UUID? Pin
Rage10-Jan-06 1:27
professionalRage10-Jan-06 1:27 
AnswerRe: How to change UUID? Pin
Stephen Hewitt9-Jan-06 21:46
Stephen Hewitt9-Jan-06 21:46 
GeneralRe: How to change UUID? Pin
<color>Aljechin 9-Jan-06 23:09
<color>Aljechin 9-Jan-06 23:09 
GeneralRe: How to change UUID? Pin
Stephen Hewitt10-Jan-06 2:56
Stephen Hewitt10-Jan-06 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.