Exception on windows::stream_handle!

26 May
2010
26 May
'10
9:05 a.m.
Hello, We are trying to create a "windows::stream_handle" from a native Windows HANDLE. But it throws an exception with "The parameter is incorrect". The code is given below. What could be the reason? (Another IOservice is already running in the system) HANDLE FileHandle=CreateFile("MyFile",FILE_WRITE_DATA,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL); if(FileHandle==INVALID_HANDLE_VALUE) { return; } try { io_service ios; windows::stream_handle StreamHandle(ios,FileHandle); .... .... } catch(std::exception& e) { Log(e.what()); //The parameter is incorrect } Thanks, Lloyd ______________________________________ Scanned and protected by Email scanner
5386
Age (days ago)
5386
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lloyd