Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

v0id

How do you open the cd-rom in c++

This topic is 5977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just wondering if anyone could give me the code to open the CD-ROM drive in c++ in windows

Share this post


Link to post
Share on other sites
Advertisement
In what way ? do you just want to open files, in which case the standard methods (fopen, CreateFileEx etc.) will work fine - or do you want to be able to read the raw data - block by block - like a MP3 ripper ? - in that case try searching for AKRIP - I can''t remember the address - I think it may be on source forge - but anyhow it''s an open source program that uses WNASPI to access the CD & read the raw data - I think it''s also got some ASPI tuts

Share this post


Link to post
Share on other sites
If you''re trying to eject the cd-rom, then it''s not too hard:

#include <mmsystem.h>

mciSendString("set cdaudio door open", NULL, 0, NULL);

Share this post


Link to post
Share on other sites
yeah i just want to know how to pop the drive open, so i can mess with my friends computer

Share this post


Link to post
Share on other sites
You mean like a Trojan?? *tsk tsk*

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you are using the Dev-C++ compiler, use this

mciSendString("set cdaudio door open", NULL, 0, NULL);

you can also set the door to close using closed as your option instead of open

p.s.Thanks for this(did not know about it yet in my young programming lifetime)...I got my mother and daughter both with this thinking that they had ran a bug or virus...heehe...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you are using the Dev-C++ compiler, use this

mciSendStringA("set cdaudio door open", NULL, 0, NULL);

forgot this one up above...the ''A''..sorry for the double-post!

you can also set the door to close using closed as your option instead of open

p.s.Thanks for this(did not know about it yet in my young programming lifetime)...I got my mother and daughter both with this thinking that they had ran a bug or virus...heehe...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hmmm, is it just my browser, or does something in the sig of BlackJester make the formating of this thread look somewhat weird ?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!