Solved

Component unidentified in DLL

Posted on 2002-04-10
6
202 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 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

18 Experts available now in Live!

Get 1:1 Help Now