Using Windows and MMSystem in Delphi

Posted by Jose Martinez on Stack Overflow See other posts from Stack Overflow or by Jose Martinez
Published on 2013-11-10T20:10:03Z Indexed on 2013/11/10 21:55 UTC
Read the original article Hit count: 780

Filed under:

Hi I am making a program to open and close the cd reader in which I have thought to write data to CD, the problem is the basis of the problem, which use "uses Windows 'and' uses MMSystem" but the problem is that when I use both at the same time being "uses Windows, MMSystem" gives an error and the program does not compile, I am using Delphi 2010, the strange thing is that when I use only one either Windows or MMSystem works fine and compiles.

The error when I try to compile is: 'Could not find program'

The code in question is this:

mciSendString ('Set cdaudio door open wait', nil, 0, handle);

I have two things to ask you first is how I avoid the error when using the two (Windows and MMSystem) and the other question was if he could open the CD player without using MMSystem, bone using Windows API, but not where to start

The source :

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils,Windows,MMSystem;

procedure opencd;
begin
  mciSendString('Set cdaudio door open wait', nil, 0, 0);
end;

begin
  try
    Writeln('test');
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Image :

test

© Stack Overflow or respective owner

Related posts about delphi