when i use CreateFile function like below ...it gives me valid handle
HANDLE hDevice = CreateFile (TEXT("\\\\.\\G:"),
0,FILE_SHARE_READ | FILE_SHARE_WRITE, // share mode
NULL, OPEN_EXISTING, 0, NULL);
if( hDevice == INVALID_HANDLE_VALUE )
{
qDebug()<<"In valid handle";
}
else
{
qDebug()<<"valid handle";
}
when i use like below ...it gives me invalid handle..
WCHAR Drive[4];
qDebug ()<<QString::fromWCharArray ( Drive );
The above prints like "G:\"
HANDLE hDevice = CreateFile ( Drive,
0,FILE_SHARE_READ | FILE_SHARE_WRITE, // share mode
NULL, OPEN_EXISTING, 0, NULL);
if( hDevice == INVALID_HANDLE_VALUE )
{
qDebug()<<"In valid handle";
}
else
{
qDebug()<<"valid handle";
}
How can i change the wchar to LPCWSTR
Thank you