![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
app has heavy payload on exit
im creating a program that simply controls your cd-rom drive, opens/closes/runs it etc...if anyone can though i would highly appreciate to know why a peice of code ( below ) likes to hang or engages in the 'error report' procedure when you exit the form, or it can sometimes happen when the 'Open' button is pressed a couple of times without a gap/giving the drawer time to fully open or close. information granted to me on this matter would be a real relief and appreciated considerably.
Thanks for you time. 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()
Dim lngReturn As Long
Dim strReturn As Long
lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
End Sub
Private Sub cmdClose_Click()
Dim lngReturn As Long
Dim strReturn As Long
lngReturn = mciSendString("set CDAudio door closed", strReturn, 127, 0)
End Sub
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles.. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Yeah, I recall this problem for windows XP. Don't know about 2000 and up, but I know it worked for windows 98. When I moved it to XP, I get the same error. I've googled it, but can't find an answer. Anyone else know? I would sure like to know
![]() |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
for me this problem persists on ME also. havnt tried any others than XP and ME though.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles.. |
|
|
|
|
|
#4 |
|
Expert Programmer
|
So I decided to look into this, and so I tested your code, and it worked, no problem for me...lol. I've looked it up on google, and have come to the idea that this may not be OS related. It might come down to hardware. Perhaps consider finding a different variation of the code? Although, for the most part, it all seems to be the same. I'm not sure what to think of this one. Maybe one of the more experienced members will have the answer.
[EDIT] Perhaps it doesn't work, my VS 2005 debugger is kicking in. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|