Solved

Component unidentified in DLL

Posted on 2002-04-10
6
203 Views
Last Modified: 2010-08-05
Hello When i drop XAplayer Component on a form it everything works

But when i try to use the same code from the form in my DLL it wont work..

This is the complete working code on the form
//////////////////////////

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ExtCtrls, XAPlayer, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    XAPlayer1: TXAPlayer;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
//Var
//Player: XAPlayer.TXAPlayer;
Begin
//Player:= Nil;

   XAPlayer1.LoadXAudio;
   XAPlayer1.InputOpen ('C:\charlie rich - the most beautiful girl.mp3');
   XAPlayer1.play;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin

end;

end.
////////////////////

I include the XAPlayer in my uses.
Thanks in advance DB
0
Comment
Question by:Dinkleburger
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6931377
maybe you must use the registerclass-method in somewhere in your  dll-modul
0
 
LVL 17

Expert Comment

by:geobul
ID: 6931495
Perhaps you have to create it first using its Create method.

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6932064
good point, geo :-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Dinkleburger
ID: 6933152
Hi geo
Do you mean create the Component?
the component is called XAPlayer, if so
can you show me what the create code should look like
Thanks
0
 
LVL 17

Accepted Solution

by:
geobul earned 20 total points
ID: 6933217
Hi,
It depends on what parameters Create method needs. For visual controls the usual syntax is:

Var
  Player: TXAPlayer;
....
Begin
 Player := TXAPlayer.Create(Form1);
 // or Player := TXAPlayer.Create(nil);
 try
  Player.Parent := Form1; // important for visualization
  ....//use it here
 finally
  Player.Free; // free the object at last
 end;
end;

--------
hi meikl :-)

Regards, Geo
0
 

Author Comment

by:Dinkleburger
ID: 6933512
Thanks for that it works now the Mp3 is playing without user interface Cool
DB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now