QUOTE(doomlord52 @ 6 Dec, 2007 - 07:33 PM)

CODE
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 CommandButton1_Click()
Dim Iret As Long
Iret = mciSendString("Set CDAudio door open", ReturnString, 127, 0)
End Sub
Private Sub CommandButton2_Click()
Dim Iret As Long
Iret = mciSendString("Set CDAudio door closed", ReturnString, 127, 0)
End Sub
What is wrong with the code!!!
(It is the code to open CD drive, and close it.
Const ReturnString = 13
QUOTE(doomlord52 @ 6 Dec, 2007 - 07:33 PM)

CODE
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 CommandButton1_Click()
Dim Iret As Long
Iret = mciSendString("Set CDAudio door open", ReturnString, 127, 0)
End Sub
Private Sub CommandButton2_Click()
Dim Iret As Long
Iret = mciSendString("Set CDAudio door closed", ReturnString, 127, 0)
End Sub
What is wrong with the code!!!
(It is the code to open CD drive, and close it.
Or try:
Dim ReturnString as String
ReturnString = chr$(13)