|
Boost Users : |
Subject: [Boost-users] Exception on windows::stream_handle!
From: Lloyd (lloyd_at_[hidden])
Date: 2010-05-26 05:05:25
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net