Link to home
Start Free TrialLog in
Avatar of zitt
zitt

asked on

Associating CD Drive Letters to Manufacturer strings

I'm using several thirdparty ActiveX controls in my application in combination with Delphi's TMediaPlayer VCL.

What I need to do is figure out which Drive letters are associated with the CDWriter in a persons computer. The activeX control I use will give me the manufacturer (say Yamaha) and model number (ex: CRW6416SX) but not the drive letter it's associated with.

Does anyone know how I would associate the two?

John
Avatar of ckaneta
ckaneta

from the peanut gallery:


function TForm1.FindFirstCDROM: shortstring;
var  AList: TStringList; Counter: integer;
 begin
  Result := 'no CDROM present';
  AList := TStringList.Create;
  ListDrives(AList);
  for Counter := 0 to AList.Count-1 do
    if GetDriveType(PChar(Alist.Strings[Counter])) = DRIVE_CDROM then
      Result := Alist.Strings[Counter]
 end;
procedure TForm1.ListDrives(Strings: TStringList);
const BufSize = 256;
var Buffer,P : PChar;
 begin
  GetMem(Buffer, BufSize);
  try
   Strings.BeginUpdate;
   try
    Strings.Clear;
    if GetLogicalDriveStrings(BufSize, Buffer) <> 0 then begin
     P := Buffer;
     while P^ <> #0 do begin
      Strings.Add(P);
      Inc(P, StrLen(P) + 1);
     end;
    end;
   finally
    Strings.EndUpdate;
   end;
  finally
   FreeMem(Buffer, BufSize);
  end;
 end;
Avatar of zitt

ASKER

Thankyou,

I already had a list of the CDROM drives.

What I need now is to associate each drive letter with the manufacturer and model of the cddrive.

Example:
F: = Kenwood 72x TrueSpin
G: = Yamaha CRW6416SX

John
ASKER CERTIFIED SOLUTION
Avatar of jeurk
jeurk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, I pasted my texte twice.

what you want to do is something I wanted to since a long time for drives.
I would like to make a list of all the logical drives and tell on which hard disk they are...
Avatar of zitt

ASKER

I'll look into your code. Thanks!

The reason I need this kind of info, is because my program, CDMaster32 (http://www.zittware.com/cdmaster32.html) now has AudioCD Burning capablity.

If a user creates an AudioCD using my software, I'd want to transfer the data back to the local CD database so the information appears there.

The CDWriter software, only knows the Drive manufacturer... my CDDatabase only knows the drive by drive letter.

John
Avatar of zitt

ASKER

jeurk,

Thanks. While your code wouldn't work for my system... It pointed me in the right direction.

On my system, The CDROM devices are under 'Enum\SCSI'.

Also, this solution only works for Win9x.

I didn't see a way for NT to do the same thing. IE the registery is missing the "CurrentDriveLetterAssignment" entry.

John
yups, that's true, esdi is for the IDE hard drives and scsi for the scsi hard drives and the cdrom's...
but they must be a way because easy cd creator is doing it for example...
I hadd not emough time to investivate that...
If you find the answer I would appreciate that you tell it to me...
knipjo@hotmail.com, thanks.

-John ;)
Avatar of zitt

ASKER

BTW: on my system, even my IDE LS-120 was listed in the SCSI area.

I doubt we'll every find some real MS documentation to give us a real answer to this problem.

John