Results 1 to 10 of 10

Thread: CD-Rom Drive?

  1. #1
    Guest

    Question

    Ok, this happens once in a while, I went to open my CD-Rom drive and it did not open. The light went on, but nothing happened. I shutdown. Nothing. I pressed it a number of times in a row. Nothing. I tried this code:

    Code:
    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
    
    Dim lngReturn As Long
    lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
    Nothing! I know this will go away, because it usually does. Takes about an hour though. Is it my computer being stubborn? Why does this happen only once in a while? Anyone got any other suggestions?

  2. #2
    Addicted Member hypnos's Avatar
    Join Date
    Aug 2000
    Location
    UK
    Posts
    183
    Make sure none of the Scsi settings are enabled in device manager. It's happend to me before.

  3. #3
    Guest
    The only thing that is on the SCSI is Zip Drive and there is no conflict or anything. Maybe my computer's mad at me. It happens sometimes. Thanks for helping, I'm sure it will work again, it's probably just that time of month again.

  4. #4
    Addicted Member hypnos's Avatar
    Join Date
    Aug 2000
    Location
    UK
    Posts
    183

    Talking

    I’ve had so many problems with CD ROMs. I have gone through 3 in less then 1 year! Maybe they just don’t make them like they used to?

  5. #5
    Guest
    Matthew, try this,
    I got this form from Yonatan, it uses VB to write to a .com file written in ASM.

    paste this into a text file and rename it to "Form1.frm"

    Code:
    VERSION 5.00
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   3195
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   4680
       LinkTopic       =   "Form1"
       ScaleHeight     =   3195
       ScaleWidth      =   4680
       StartUpPosition =   3  'Windows Default
       Begin VB.CommandButton cmdEject 
          Caption         =   "Command1"
          Height          =   495
          Left            =   1740
          TabIndex        =   1
          Top             =   1440
          Width           =   1215
       End
       Begin VB.DriveListBox drvList 
          Height          =   315
          Left            =   420
          TabIndex        =   0
          Top             =   900
          Width           =   3735
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option Explicit
    
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    
    Private Const STANDARD_RIGHTS_REQUIRED = &HF0000
    Private Const SYNCHRONIZE = &H100000
    Private Const PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &HFFF
    Private Const INFINITE = &HFFFFFFFF
    
    Private Sub cmdEject_Click()
        Dim lProcessID As Long, hProcess As Long
        Dim bFile(1 To 17) As Byte, bFileNum As Byte, bDriveNum As Byte, sFileName As String
        ' 1 To 17 because the assembly code takes up 17 bytes of disk space.
        
        If Caption = "Busy..." Then Exit Sub
        Tag = Caption
        Caption = "Busy..."
        cmdEject.Enabled = False
        DoEvents ' Update caption
        
        ' First lets get the DriveNum.
        ' The upper case of the first word in drvList.Drive is A, or B, etc.
        ' ASCII codes: A = 65, B = 66, etc. Requested: A = 1, B = 2, etc.
        ' We just need to decrement 64 from the ASCII code.
        bDriveNum = Asc(UCase(Left(drvList.Drive, 1))) - 64
        
        ' mov ax, 440Dh
        ' "mov ax" = B8
        ' Then the source 440D in little-endian format: 0D 44
        ' "mov ax, 440Dh" = B8 0D 44
        bFile(1) = &HB8
        bFile(2) = &HD
        bFile(3) = &H44
        
        ' mov bx, DriveNum
        ' "mov bx" = BB
        ' Then the source DriveNum in little-endian format.
        ' Since DriveNum is a number between 1 and 26, its high byte will ALWAYS be zero.
        ' Since this is a little-endian system, first goes the low byte, then the high byte.
        ' So DriveNum can be expressed like this: [bDriveNum] 00
        ' "mov bx, DriveNum" = BB [bDriveNum] 00
        bFile(4) = &HBB
        bFile(5) = bDriveNum
        bFile(6) = &H0
        
        ' mov ch, 8
        ' "mov ch" = B5
        ' Then the source 8 is one byte... Just: 08
        ' "mov ch, 8" = B5 08
        bFile(7) = &HB5
        bFile(8) = &H8
        
        ' mov cl, 49h
        ' "mov cl" = B1
        ' Then the source 49 is again, one byte... Just: 49
        ' "mov cl, 49h" = B1 49
        bFile(9) = &HB1
        bFile(10) = &H49
        
        ' int 21h
        ' "int" = CD
        ' The interrupt 21h is just one byte: 21
        ' "int 21h" = CD 21
        bFile(11) = &HCD
        bFile(12) = &H21
        
        ' mov ax, 4C00h
        ' "mov ax" = B8
        ' Then the source 4C00 in little-endian format: 00 4C
        ' "mov ax, 4C00h" = B8 00 4C
        bFile(13) = &HB8
        bFile(14) = &H0
        bFile(15) = &H4C
        
        ' int 21h
        ' Didn't change since before: CD 21
        bFile(16) = &HCD
        bFile(17) = &H21
        
        ' Now that we are done with converting the source code to hex,
        ' we can save the data to a .com file and run it.
        sFileName = App.Path
        If Not Right(sFileName, 1) = "\" Then sFileName = sFileName & "\"
        sFileName = sFileName & "eject.com"
        
        bFileNum = FreeFile
        Open sFileName For Binary As bFileNum
            Put bFileNum, , bFile() ' Write Assembly data
        Close bFileNum
        
        lProcessID = Shell(sFileName, vbHide) ' Execute it, hidden from the user
        
        On Error Resume Next
        hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, lProcessID) ' Open the process
        If hProcess = 0 Then ' Already ended. Happens
            Call Kill(sFileName)
            Exit Sub
        End If
        Call WaitForSingleObject(hProcess, INFINITE) ' Wait for it to end
        Call CloseHandle(hProcess) ' Close the process handle
        
        Call Kill(sFileName) ' Destroy the file
        
        cmdEject.Enabled = True
        Caption = Tag
    End Sub

  6. #6
    Guest
    All it says is "Busy" Dennis.

    It's still not working, but I looked in the Device Manager and under CD-ROM, the driver is listed and in it, for the settings, it has Options. These are the options:

    Disabled > Checked
    Sync Data Transfer > Not Checked
    Auto Insert Notification > Checked
    Removable > Checkbox Disabled
    Int 13 Unit > Checkbox Disabled
    DMA > Not Checked

    Would it be safe to Uncheck Disabled? Maybe that's the reason? If that doesn't work...rush emergency - computer hospital .

  7. #7
    Addicted Member hypnos's Avatar
    Join Date
    Aug 2000
    Location
    UK
    Posts
    183

    Smile

    If there is a disable check box that is checked I would say that's the problem. Just uncheck it and let us know if it worked. Gook Luck!

  8. #8
    Guest
    That did not harm me...nor did it do anything.
    Still won't work!
    Anyone got any other suggestions before I go get the hammer?

    Maybe it's because I don't use it much, I haven't used it in over a month. And I just bought Visual Basic 6.0 and I went to put the CD in and it wouldn't open .

  9. #9
    Addicted Member hypnos's Avatar
    Join Date
    Aug 2000
    Location
    UK
    Posts
    183

    Smile

    It maybe the power lead. Believe it or not, the CD ROMs light would still come on if the power lead wasn't plugged in because the data ribbon has a very low voltage inside. I've seen it myself! Maybe you should open the back of your computer and check that all the leads are correctly inserted into the CD ROM.

  10. #10
    Guest
    Okay, I take the computer to the computer hospital and the guy hooks it up, plugs it in, and it works fine. But he said a 24x was a bit slow and outdated. So he gives me the idea to put a paper clip in the little hole (HeSaidJoe emailed me about this later also), so I get home and I press the button, and it doesn't work. So I use a paper clip and it opens, but now, the light won't go on at all. So I close the CD-ROM manually and now, it's dead. So I took it back today, since I know the owner, she let me install the new CD-ROM drive and doesn't charge me for labor ($75), but just charges me for the CD-ROM ($60). Now I bring it home, works now, and I can install Visual Basic 6.0, finally. Thank you all for your help.

    Just letting you know the end of the story .

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