Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Select one from two CDRom drives

Posted on 2000-03-17
18
Medium Priority
?
277 Views
Last Modified: 2010-04-04
Hy,
I have two CD-ROM drives : E:\ and F:\
My default drive is E:\ .
How can I select my second drive for open and close the door or play .
0
Comment
Question by:ginsonic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 4
  • +1
18 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2627142
Hi
look to this:
http://www.delphipages.com

and type tcdevents in the search box.
this is zifnabs cd component which you can use to change default drives .
(comes with full sources)


description:
This component will notify you when the user inserts/removes a CD from the CD-rom drive by pushing the eject button. Next to this some other usefull CD related options are available, like enabling/disabling autorun (CD & audio CD), changing the default cd-player, ...

Regards Barry
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627189
Nick,

Just do this

MediaPlayer1.FileName := 'F:';

You can now just use the TMediaPlayer component like before. No extra components, no extra codes, no larger EXEs etc.

The Neil
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627246
Hy Inthe ,
I can't install CDEvents in my D4 .
I installed but I haven't the classes in my compiler. TCDEvents and .... I don't remember now .
I love ideea , but I can't use it .

Hello Neil ,
How do you do ? :)
I don't wish to use TMediaPlayer .

I wish to put a CD player in my new broadcasting scheduler and I want to use API functions .
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 5

Expert Comment

by:TheNeil
ID: 2627284
Nick,

I'm doing fine. You?

Oops, I assumed you were using the TMediaPlayer component. I've never gone down and used the API to do this kind of thing and using a TMediaPlayer is the way Borland suggest you open the CD drive (not that that makes it right). All I can suggest (if you don't (or can't) use Barry's component) is hunting through the MPlayer.PAS file and seeing how the TMediaPlayer component handles an eject. I've had a quick look and it's just an MCI call BUT I couldn't see how to set the 'active' drive - sorry. The TMediaplayer approach DOES work so it should just be a case of figuring out HOW it's doing it by looking at what gets set when you set the filename (as I suggested), and how that stored value is applied to an eject.

The Neil =:)
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627455
How I know the TMediaPlayer can only open the door .
0
 
LVL 17

Expert Comment

by:inthe
ID: 2627579
for mediaplayer set the filename as "the neil" said then something like

var
handle : thandle;
begin
handle := mediaplayer1.deviceid;

//To Open:
 mciSendString('Set cdaudio door open wait', nil, 0, handle);
//To Close:
 mciSendString('Set cdaudio door closed wait', nil, 0, handle);

Make sure to include the MMSystem unit in your uses clause.
thats untested  btw so may not work.

ps i email zifnab to look here as maybe he can help in install of his component..
i tried and too had problem(no component appeared on pallete?) , although i remember i had it installed no problem in d3.

0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627623
Barry,

You might not have tested it but it certainly works (I just gave it a try and it works on my machine)

The Neil =;)
0
 
LVL 17

Expert Comment

by:inthe
ID: 2627655
ahh great
i knew the open and close worked for me once but i couldnt remember what to use for handle and coulnt see any thing else from deviceid.
thanks for saying ,i can save this in my code snippet database.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2627811
Hi,

mmm, which version of TCDevents are you using? urgh, this is already a long time that I looked at this component... I think I should make a BIG update.

I know that from a certain version, you don't have to use the reg file, but the source-code files itself (register the products itself).  Does not use the seperate reg file to install the components

Tom.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2627854
1.41 was only version i could find
(delphipages and dsp)today but i was sure it was newer version i had installed in d3.
i wait for ginsonic see what he found,
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627974
I know the API commands to open or close the door . I see many tips on net .

I use :
mciSendString('Set cdaudio door open wait', nil, 0, 0);
My problem is how to open or close the second CDROM door .
With this command I close or open the default CDROM .
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627993
Nick,

What you need to do is use a TMediaPlayer component (You don't have to open it or use it though). You set the drive as I described earlier THEN you can use mciSendString(...). If you want to get away from TMediaPlayer then try hunting through the TMediaPlayer source code and see what it does when you set the filename

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2628022
You can find the latest at Torries (1.44)
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2628577
Hy ZifNab .
I try to find 1.44 on Torries , but...
Version 1.42 don't work for me . Can U send me a mail with this ?

Regards,
Nick
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2628600
Hy ZifNab .
I try to find 1.44 on Torries , but...
Version 1.42 don't work for me . Can U send me a mail with this ?

Regards,
Nick
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2631725
Hi ginsonic,

what is your e-mail address? I'll send you the latest version. (rather old)

zif.
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2632833
Thanks Zifnab,
My email is nick@radioterra.ro .
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 2637262
you should reveive it very soon.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question