Results 1 to 3 of 3

Thread: Eject a CD in VB.NET

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Garden Grove, CA
    Posts
    72

    Eject a CD in VB.NET

    Is there any way to eject a cd through the .net framework?

    I have been using the mcisendmessage api and I know there HAS to be a way to do it.

    Right now to detect if there is no cd in the drive i'm using a thread with a loop like this
    Code:
    While Not Directory.Exists(cdDrive)
        ' Do Nothing
        Application.DoEvents
    End While
    When the CD is inserted it exits that thread. After my program does what it needs, I want to eject the cd.
    Chris Wilson

  2. #2
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Heres a link for it:

    The Code Project

    It will work using reference to his dll.


    By the way whats wrong with using the API call?
    Last edited by Hole-In-One; Jul 2nd, 2004 at 04:09 PM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Garden Grove, CA
    Posts
    72
    Originally posted by Hole-In-One
    Heres a link for it:

    The Code Project

    It will work using reference to his dll.


    By the way whats wrong with using the API call?
    That project uses the MciSendString command too. Theres nothing wrong with it but I would think that they would have other methods in the new framework. There is a XP CD burning source code also, I am not good enough with C# to follow exactly where it goes, but it does have an eject method.

    Thanks
    Chris Wilson

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