Click here to Skip to main content
15,921,295 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Activate Caption Pin
John R. Shaw26-Oct-05 16:17
John R. Shaw26-Oct-05 16:17 
GeneralRe: Activate Caption Pin
The NULL Developer26-Oct-05 19:59
professionalThe NULL Developer26-Oct-05 19:59 
QuestionIImageDecodeEventSink Pin
Carsten Leue25-Oct-05 23:17
Carsten Leue25-Oct-05 23:17 
QuestionCalling from explicitly loaded .dll Pin
DaveDrPop25-Oct-05 22:41
DaveDrPop25-Oct-05 22:41 
AnswerRe: Calling from explicitly loaded .dll Pin
Chris Losinger26-Oct-05 1:39
professionalChris Losinger26-Oct-05 1:39 
QuestionDetect USB drive writable Pin
LiYS25-Oct-05 22:24
LiYS25-Oct-05 22:24 
AnswerRe: Detect USB drive writable Pin
kakan26-Oct-05 0:46
professionalkakan26-Oct-05 0:46 
GeneralRe: Detect USB drive writable Pin
LiYS26-Oct-05 5:32
LiYS26-Oct-05 5:32 
Thanks kakan!
The code finally turned into
CString strDrive;
strDrive.Format("\\\\.\\%c:", 'C');
HANDLE hDrive = CreateFile(strDrive,  GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
                            NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
DWORD dwRet;

BOOL bWritable = DeviceIoControl(hDrive, IOCTL_DISK_IS_WRITABLE, NULL, 0, NULL, 0,
                                    &dwRet, NULL);

But the question is I have "C;D;E;F;G(CDROM)" drives, if I don't specify dwDesiredAccess as GENERIC_READ | GENERIC_WRITE, the returned hDrive for "C;D;E" is INVALID_HANDLE_VALUE, and all the accessable drives' hDrive(valid) is the same(0x000006f8). Is this normal?



GeneralRe: Detect USB drive writable Pin
Blake Miller26-Oct-05 6:59
Blake Miller26-Oct-05 6:59 
GeneralRe: Detect USB drive writable Pin
kakan26-Oct-05 19:35
professionalkakan26-Oct-05 19:35 
GeneralRe: Detect USB drive writable Pin
LiYS27-Oct-05 19:19
LiYS27-Oct-05 19:19 
QuestionHow to set a Textcolor in a CListCtrl Pin
bosfan25-Oct-05 22:23
bosfan25-Oct-05 22:23 
AnswerRe: How to set a Textcolor in a CListCtrl Pin
prasad_som25-Oct-05 23:34
prasad_som25-Oct-05 23:34 
GeneralRe: How to set a Textcolor in a CListCtrl Pin
Anonymous26-Oct-05 1:02
Anonymous26-Oct-05 1:02 
QuestionHow can I get a copy of wav file with other format Pin
extraf25-Oct-05 21:38
extraf25-Oct-05 21:38 
AnswerRe: How can I get a copy of wav file with other format Pin
Blake Miller26-Oct-05 7:00
Blake Miller26-Oct-05 7:00 
QuestionHide the blue task pane in a CHtmlView Pin
gleditzsch25-Oct-05 21:26
gleditzsch25-Oct-05 21:26 
QuestionDensity sampling Pin
Arrun25-Oct-05 20:50
Arrun25-Oct-05 20:50 
Questionprime number with recursion Pin
Rajesh_K_Sharma25-Oct-05 20:07
Rajesh_K_Sharma25-Oct-05 20:07 
AnswerRe: prime number with recursion Pin
sunit525-Oct-05 22:11
sunit525-Oct-05 22:11 
GeneralRe: prime number with recursion Pin
toxcct25-Oct-05 22:25
toxcct25-Oct-05 22:25 
AnswerRe: prime number with recursion Pin
ddmcr25-Oct-05 22:57
ddmcr25-Oct-05 22:57 
JokeRe: prime number with recursion Pin
toxcct25-Oct-05 23:15
toxcct25-Oct-05 23:15 
GeneralRe: prime number with recursion Pin
ThatsAlok26-Oct-05 0:00
ThatsAlok26-Oct-05 0:00 
GeneralRe: prime number with recursion Pin
toxcct26-Oct-05 0:08
toxcct26-Oct-05 0:08 

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.