Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Text to Long Pin
kakan22-Dec-05 20:30
professionalkakan22-Dec-05 20:30 
GeneralRe: Text to Long Pin
itkid22-Dec-05 21:07
itkid22-Dec-05 21:07 
GeneralRe: Text to Long Pin
vikas amin22-Dec-05 22:03
vikas amin22-Dec-05 22:03 
GeneralRe: Text to Long Pin
Eytukan22-Dec-05 22:47
Eytukan22-Dec-05 22:47 
GeneralRe: Text to Long Pin
itkid22-Dec-05 21:13
itkid22-Dec-05 21:13 
AnswerRe: Text to Long Pin
sunit522-Dec-05 20:35
sunit522-Dec-05 20:35 
AnswerRe: Text to Long Pin
Michael Dunn22-Dec-05 21:24
sitebuilderMichael Dunn22-Dec-05 21:24 
QuestionSTL or <afxtempl.h> Pin
s o v a n n22-Dec-05 19:31
s o v a n n22-Dec-05 19:31 
AnswerRe: STL or <afxtempl.h> Pin
Bob Stanneveld22-Dec-05 20:09
Bob Stanneveld22-Dec-05 20:09 
GeneralRe: STL or <afxtempl.h> Pin
s o v a n n22-Dec-05 21:16
s o v a n n22-Dec-05 21:16 
GeneralRe: STL or <afxtempl.h> Pin
Bob Stanneveld23-Dec-05 22:19
Bob Stanneveld23-Dec-05 22:19 
GeneralRe: STL or <afxtempl.h> Pin
s o v a n n24-Dec-05 21:10
s o v a n n24-Dec-05 21:10 
GeneralRe: STL or <afxtempl.h> Pin
Dudi Avramov25-Dec-05 23:35
Dudi Avramov25-Dec-05 23:35 
GeneralRe: STL or <afxtempl.h> Pin
s o v a n n26-Dec-05 19:21
s o v a n n26-Dec-05 19:21 
QuestionSend file/string Pin
mambohoe8122-Dec-05 18:47
mambohoe8122-Dec-05 18:47 
AnswerRe: Send file/string Pin
Owner drawn22-Dec-05 21:00
Owner drawn22-Dec-05 21:00 
AnswerRe: Send file/string Pin
vikas amin22-Dec-05 22:15
vikas amin22-Dec-05 22:15 
GeneralRe: Send file/string Pin
mambohoe8122-Dec-05 23:12
mambohoe8122-Dec-05 23:12 
AnswerRe: Send file/string Pin
Gary R. Wheeler24-Dec-05 3:19
Gary R. Wheeler24-Dec-05 3:19 
GeneralRe: Send file/string Pin
mambohoe8124-Dec-05 5:42
mambohoe8124-Dec-05 5:42 
GeneralRe: Send file/string Pin
Gary R. Wheeler24-Dec-05 9:53
Gary R. Wheeler24-Dec-05 9:53 
GeneralRe: Send file/string Pin
mambohoe8127-Dec-05 0:47
mambohoe8127-Dec-05 0:47 
QuestionWhy DeviceIoControl always return 0? Pin
kkwu21622-Dec-05 17:08
kkwu21622-Dec-05 17:08 
Dear all,
I have tried to get the drive letter of specific USB device. Below is my code. I cannot get a proper return value from DeviceIoControl. Please help and advice me how to make it work. Thanks.

TCHAR diskletter[10];

for(char le='C';le<'T';le++)
{
drive.Format ("%c:",le);
if(GetDriveType(drive)==DRIVE_FIXED||GetDriveType
(drive)==DRIVE_REMOVABLE)
{
sprintf(diskletter,"\\\\.\\%c:",le);
HANDLE handle;
handle=CreateFile(diskletter, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,OPEN_EXISTING, NULL, NULL);
if (handle = INVALID_HANDLE_VALUE)
MessageBox("Open device failed");
else
{
STORAGE_DEVICE_DESCRIPTOR pDevDesc;
STORAGE_PROPERTY_QUERY Query;
DWORD dwOutBytes;
BOOL bResult;
Query.PropertyId= StorageDeviceProperty;
Query.QueryType = PropertyStandardQuery;

bResult=DeviceIoControl(handle,
IOCTL_STORAGE_QUERY_PROPERTY,
&Query, sizeof(STORAGE_PROPERTY_QUERY),
&pDevDesc, pDevDesc.Size,
&dwOutBytes,
(LPOVERLAPPED)NULL);
if(!bResult)
MessageBox("Get bus type failed");
if(pDevDesc.BusType == BusTypeUsb)
m_Editi=m_Editi+le;

CloseHandle(handle);
}
}
Questionreplace usp10.dll Pin
dung nam22-Dec-05 14:25
dung nam22-Dec-05 14:25 
Questionwriting native windows service using vc++2005 Pin
orid22-Dec-05 13:57
orid22-Dec-05 13:57 

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.