CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 1999
    Posts
    69

    URGENT ! Eject CDROM programmatically

    How do I eject the CDROM drive from my program?


  2. #2
    Join Date
    Apr 1999
    Posts
    2

    Re: URGENT ! Eject CDROM programmatically

    You can download the source code at
    http://www.codeguru.com/multimedia/cd_audio.shtml


  3. #3
    Join Date
    May 1999
    Posts
    69

    Re: URGENT ! Eject CDROM programmatically

    Hey, thanks, but I don't need any of that CD Audio system stuff, just the part that ejects / closes the CDROM drive. I can't use only that part from the sample without having the rest, and it'll just weigh my program down unnecessarily. Can you tell me the bare minimum I need to do open/close the door? I isolated the function that did it, but what about the initialization and everything on which the function indirectly depends?


  4. #4
    Join Date
    Apr 1999
    Location
    Huntsville, Al
    Posts
    27

    Re: URGENT ! Eject CDROM programmatically

    Have a look at DeviceIoControl. The way you use it depends on if you are running 95/98 or NT

    Hope this helps,
    Gary Kirkham


  5. #5
    Join Date
    Apr 1999
    Posts
    12

    Re: URGENT ! Eject CDROM programmatically

    #include <windows.h>

    void main(void)
    {
    char returnstring[1024];
    MCIERROR result;
    result = mciSendString("set CDAudio door closed",
    returnstring, 127, 0);
    }


  6. #6
    Join Date
    May 1999
    Posts
    69

    Re: URGENT ! Eject CDROM programmatically

    Hey, thanks a lot dude!
    Just one more thing... if I want to detect the current state (open/closed) and then give the appropriate command(close/open), what should I do?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured