Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using MFC to access the internet Pin
Hamid_RT6-Sep-07 7:26
Hamid_RT6-Sep-07 7:26 
AnswerRe: Using MFC to access the internet Pin
ThatsAlok5-Sep-07 23:33
ThatsAlok5-Sep-07 23:33 
QuestionINT_PTR Pin
nitin35-Sep-07 19:32
nitin35-Sep-07 19:32 
AnswerRe: INT_PTR Pin
Michael Dunn5-Sep-07 19:39
sitebuilderMichael Dunn5-Sep-07 19:39 
GeneralRe: INT_PTR Pin
nitin35-Sep-07 20:19
nitin35-Sep-07 20:19 
GeneralRe: INT_PTR Pin
toxcct6-Sep-07 1:19
toxcct6-Sep-07 1:19 
QuestionRe: INT_PTR Pin
David Crow6-Sep-07 3:32
David Crow6-Sep-07 3:32 
QuestionCD ROM open close problem Pin
p_5-Sep-07 19:22
p_5-Sep-07 19:22 
hi all vc++ masters \
i use this code for cd rom open and close
but this gives

'OpenVolume' : local function definitions are illegal
'OpenVolume' : cannot convert parameter 1 from 'char [3]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast

NOTE:the line contain stars shows errors;

DWORD IOCTL_STORAGE_EJECT_MEDIA;
DWORD bytesreturned;
HANDLE OpenVolume(TCHAR cDriveLetter)
****{HANDLE hVolume;
UINT uDriveType;
TCHAR szVolumeName[8];
TCHAR szRootName[5];
DWORD dwAccessFlags;

wsprintf(szRootName, szRootFormat, cDriveLetter);

uDriveType = GetDriveType(szRootName);
switch(uDriveType) {
case DRIVE_REMOVABLE:
dwAccessFlags = GENERIC_READ | GENERIC_WRITE;
break;
case DRIVE_CDROM:
dwAccessFlags = GENERIC_READ;
break;
default:
_tprintf(TEXT("Cannot eject. Drive type is incorrect.\n"));
return INVALID_HANDLE_VALUE;
}

wsprintf(szVolumeName, szVolumeFormat, cDriveLetter);

hVolume = CreateFile( szVolumeName,
dwAccessFlags,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL );
if (hVolume == INVALID_HANDLE_VALUE)
ReportError(TEXT("CreateFile"));

return hVolume;
}
*****HANDLE hVolume = OpenVolume("D:");DeviceIoControl( hVolume, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &bytesreturned, NULL );
thanks

special thanks to MR Naveen
AnswerRe: CD ROM open close problem Pin
nitin35-Sep-07 20:07
nitin35-Sep-07 20:07 
GeneralRe: CD ROM open close problem Pin
p_5-Sep-07 20:23
p_5-Sep-07 20:23 
GeneralRe: CD ROM open close problem Pin
nitin35-Sep-07 20:41
nitin35-Sep-07 20:41 
GeneralRe: CD ROM open close problem Pin
p_5-Sep-07 22:10
p_5-Sep-07 22:10 
QuestionWindows Filtering Platform Pin
shiraztk5-Sep-07 19:02
shiraztk5-Sep-07 19:02 
QuestionCan anybody tell me how to find out the drive partitioning of a stand alone machine using c++ Pin
philiptabraham5-Sep-07 18:12
philiptabraham5-Sep-07 18:12 
QuestionRecording keystrokes Pin
hxhl955-Sep-07 18:11
hxhl955-Sep-07 18:11 
QuestionRe: Recording keystrokes Pin
baerten5-Sep-07 20:59
baerten5-Sep-07 20:59 
AnswerRe: Recording keystrokes Pin
GauranG Shah6-Sep-07 0:40
GauranG Shah6-Sep-07 0:40 
QuestionRe: Recording keystrokes Pin
hxhl956-Sep-07 17:13
hxhl956-Sep-07 17:13 
Questionout-of-proc server COM Pin
George_George5-Sep-07 18:04
George_George5-Sep-07 18:04 
AnswerRe: out-of-proc server COM Pin
DevMentor.org6-Sep-07 8:23
DevMentor.org6-Sep-07 8:23 
GeneralRe: out-of-proc server COM Pin
George_George6-Sep-07 17:28
George_George6-Sep-07 17:28 
QuestionBinary Search Trees Pin
sirtimid5-Sep-07 17:36
sirtimid5-Sep-07 17:36 
Questionweekday in number Pin
includeh105-Sep-07 16:52
includeh105-Sep-07 16:52 
AnswerRe: weekday in number Pin
bob169725-Sep-07 17:00
bob169725-Sep-07 17:00 
AnswerRe: weekday in number Pin
Michael Dunn5-Sep-07 17:16
sitebuilderMichael Dunn5-Sep-07 17:16 

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.