Skip to main content
GameDev.net gamedev.net
🔒 Locked

CD Drive Access

Started by The Mad Man Aug 29, 2000 at 8:52 PM 4 replies 600+ views
Original Post
The Mad Man
The Mad Man
I''m wondering how you access the CD-ROM drive and then use it. I''m specifically referring to opening and closing the disk door. Could anyone help me here?
Muzzafarath
Muzzafarath
Which OS are you using?
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Muzzafarath
Muzzafarath
Okay, there are Win32 API functions that being with "mci" which can be used for that. Look them up in MSDN. This is the function you can use to open the the CD door:

MCIERROR mciSendString(
  LPCTSTR lpszCommand,
  LPTSTR lpszReturnString,
  UINT cchReturn,
  HANDLE hwndCallback
);

The lpszCommand string contains a string with the command. I think you can pass it something like "set audio all on" to open the CD door. You can find more info on MSDN

Edited by - Muzzafarath on August 31, 2000 3:28:42 AM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
cyberben
cyberben
Ummm.... Mr. avatar there is playing with you or at least I''ve never seen that mci string and it logically doesn''t make sense.
I made a program that opens and closes the CD door and it uses these two (Tried, tested and true!)

"set CDAudio door open" - to open
"set CDAudio door closed" - to close

This are pretty obvious! I have no idea what "set audio all on" does but it looks like it''d make sure all the chanells are un-muted or something... Any how look at MSDN!

See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
Muzzafarath
Muzzafarath
I took a look at MSDN, it said that "set audio all off" should close the CD door... Nevermind, I''ve never tested "my" way, and since you say your way works...
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.