Click here to Skip to main content
15,918,193 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: numerical methods Pin
Russell'5-Sep-07 23:13
Russell'5-Sep-07 23:13 
GeneralRe: numerical methods Pin
mitsui587-Sep-07 4:35
mitsui587-Sep-07 4:35 
AnswerRe: numerical methods Pin
David Crow6-Sep-07 3:28
David Crow6-Sep-07 3:28 
AnswerRe: numerical methods Pin
ollydbg239-Sep-07 1:05
ollydbg239-Sep-07 1:05 
QuestionHow can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:06
yaminisridaran5-Sep-07 20:06 
AnswerRe: How can I monitor the cts pin of serial port using dcb Pin
chandu0045-Sep-07 20:26
chandu0045-Sep-07 20:26 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:30
yaminisridaran5-Sep-07 20:30 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
chandu0045-Sep-07 20:51
chandu0045-Sep-07 20:51 
AnswerRe: How can I monitor the cts pin of serial port using dcb Pin
QuickDeveloper5-Sep-07 20:41
QuickDeveloper5-Sep-07 20:41 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:43
yaminisridaran5-Sep-07 20:43 
AnswerRe: How can I monitor the cts pin of serial port using dcb Pin
Cedric Moonen5-Sep-07 20:50
Cedric Moonen5-Sep-07 20:50 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:56
yaminisridaran5-Sep-07 20:56 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
Cedric Moonen5-Sep-07 20:59
Cedric Moonen5-Sep-07 20:59 
QuestionUsing MFC to access the internet Pin
D_code_writer5-Sep-07 19:43
D_code_writer5-Sep-07 19:43 
AnswerRe: Using MFC to access the internet Pin
Hamid_RT5-Sep-07 20:20
Hamid_RT5-Sep-07 20:20 
GeneralRe: Using MFC to access the internet Pin
ThatsAlok6-Sep-07 5:19
ThatsAlok6-Sep-07 5:19 
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 

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.