Results 1 to 4 of 4

Thread: Eject

  1. #1

    Thread Starter
    Lively Member Skateboarder's Avatar
    Join Date
    Nov 2000
    Location
    Delfzijl, the Netherlands
    Posts
    66
    How do I open the cdrom? I mean ejecting it...
    To VB or not to VB, that's the question...

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    'in declarations
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    'to use
    mciSendString "set CDAudio door open", 0&, 127&, 0& 'ejects
    mciSendString "set CDAudio door closed", 0&, 127&, 0& 'shuts up
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    CD ROM EJECT

    There are other ways but this is an easy one.

    _______________________________________

    Private Declare Function mciSendString Lib "winmm.dll" Alias _
    "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
    lpstrReturnString As String, ByVal uReturnLength As Long, _
    ByVal hwndCallback As Long) As Long

    Private Sub CmdOPEN_Click()
    retvalue = mciSendString("set CDAudio door open", _
    returnstring, 127, 0)
    lblSTATUS.Caption = "Cd Drive is Open"
    End Sub

    Private Sub CmdCLOSE_Click()
    retvalue = mciSendString("set CDAudio door closed", _
    returnstring, 127, 0)
    lblSTATUS.Caption = "Cd Drive is Closed"
    End Sub
    _______________________________________


    -Smell Ya Later

  4. #4

    Thread Starter
    Lively Member Skateboarder's Avatar
    Join Date
    Nov 2000
    Location
    Delfzijl, the Netherlands
    Posts
    66
    Great, thanx guyz...
    To VB or not to VB, that's the question...

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