Hi, I am currently making myself a DLL whereby I have a procedure which adds images to an ImageList on a form. To do this I am creating a TFileListBox component using the following :

[pascal]procedure LoadImages (AppDirectory : String; AppTiles : TImageList; Form1 : TForm);
var
ImageCount : Integer;
AOwner : TComponent;
ImagePreLoad : TFileListBox;
begin
ImagePreLoad := TFileListBox.Create(AOwner);
ImagePreLoad.Parent := Form1;
ImagePreLoad.Directory := AppDirectory+'Images\';
ImagePreLoad.Mask := '.bmp';

for ImageCount := 0 to ImagePreLoad.Items.Count -1 do
begin
AppTiles.Items.Add;
AppTiles.Items[ImageCount].Picture.LoadFromFile(AppDirectory+
'Images\'+ImagePreLoad.Items[ImageCount]);
end;

ImagePreLoad.Free;
end;

exports
LoadImages;[/pascal]

This method seems to work fine while creating the component from the main source file, but when I try to create it from the DLL it brings up an error saying "TFont cannot be assigned to a TFont". I have tried assigning a font to the component but I have no luck with that. Any Ideas?

For reference the call is made using the following :

[pascal]procedure LoadImages (AppDirectory : String;AppTiles : TImageList; Form1 : TForm); external 'MyDLL.DLL';

procedure TForm1.RandomProcedure (Sender : TObject);
var
AppDirectory : String;
begin
AppDirectory := ExtractFilePath(Application.ExeName);
LoadImages (AppDirectory, AppTiles, Form1);
end;[/pascal]