[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Component unidentified in DLL

Posted on 2002-04-10
6
Medium Priority
?
219 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 80 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

872 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