3
Answers

DLL containing methods for ejectable drive access (CD drive, DVD)

vasile

vasile

20y
2.5k
1
Hello, I am having t rouble finding a windows dll that contains methods for working with ejectable drves (cdrom, etc). Specific, I need to open and close the door of a cdrom drive from code, and if I have multiple drives, to have the possibility to choose. I have found somenthing, but is a dll provided by windows media and does not satisfies my needs. Can anybody help me? vasile@ags.ro
Answers (3)
0
spgilmore

spgilmore

NA 591 0 20y
That was my guess. That's probably the most common problem, and one that I had to solve once. Long ago, I found code on the .NET that showed how to do this with the specified CDROM Drive. I'm afraid I can't find it now. It can be done with MCI, however. I've done it. Keep searching, I guess! Sorry I can't be more help.
0
vasile

vasile

NA 3 0 20y
I have done what you are saying with [DllImport] attribute, and I have successfully used SendMciString command but I cannot control which of my ejectable drives to eject. I have a cdrom and a cd writer, with SendMciString i ejected the first one. I'm intrested to choose what drive to eject.
0
spgilmore

spgilmore

NA 591 0 20y
I have always done this in native code using the functions in mmsystem.h (e.g. SendMCIString() and SendMCICommand() ). I think I can do this in .NET with Delphi, but C# needs to use PInvoke. Is this what you're saying you've tried? What do you need to do that it doesn't do?