in a package i have a unit with a form2, loading the package in my project
work fine but getcall and findclass give me evry time nil back. i am going
crazy !''!+!'*'!
any ideas???
thanx daniel
w2000 d6sp1
application call:
------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
PackageModule: HModule;
AClass: TPersistentClass;
begin
PackageModule :=
LoadPackage('E:\Programme\Borland\Delphi6\Projects\Bpl\Package1.bpl');
if PackageModule <> 0 then //<- work OK
begin
AClass := GetClass('TForm2'); //<-- evry time NIL
if AClass <> nil then
with TComponentClass(AClass).Create(Application)
as TCustomForm do
begin
ShowModal;
Free;
end;
UnloadPackage(PackageModule);
end;
end;
------------------------------
form2 in package code:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm2 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
initialization
RegisterClass(TForm2);
finalization
UnRegisterClass(TForm2);
end.
Did you build the host app with run-time packages, at minimum with VCL60.bpl?
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be