Solved

Component unidentified in DLL

Posted on 2002-04-10
6
207 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
[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
  • 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
Independent Software Vendors: 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 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Firemonkey Need Sample for Online Shopping Example. 2 193
How to debug For loops? 3 63
Delphi Seattle StructureView color 1 22
Firemonkey Listview item popup menu ? 1 38
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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