Hi, I have a problem where a TAnimate component refuses to open an AVI from a .dll file I compiled.
My resource file is written as:
It compiles correctly (or I'm guessing it does as the filesize is correct).
Then I use Delphi to compile it into a .dll with the following:
The result of this also has the correct file size.
The TAnimate has the following code to load this:
ExePath is a string, Temp is a PChar and LibraryID is a THandle.
As far as I can tell from my debugging attempts, it fails on the line that sets ResHandle. I've checked and the filename is correct. LibraryID is a number around 15728640 (that was what it was when I checked just now).
The error message it gives me is simply "Cannot open AVI" with no extra help.
Any ideas?
My resource file is written as:
Code:
100 AVI "[Flename]"
It compiles correctly (or I'm guessing it does as the filesize is correct).
Then I use Delphi to compile it into a .dll with the following:
Code:
Library s1;
{$R *.RES}
{$R season1.res}
Begin
End.
The result of this also has the correct file size.
The TAnimate has the following code to load this:
Code:
ExePath := ExtractFilePath(Application.ExeName);
Temp := PChar(ExePath+'s1.dll');
LibraryID := LoadLibrary(Temp);
If LibraryID > 0 then
begin
video.Visible := True;
video.ResHandle := LibraryID;
video.ResID := 100;
end;
ExePath is a string, Temp is a PChar and LibraryID is a THandle.
As far as I can tell from my debugging attempts, it fails on the line that sets ResHandle. I've checked and the filename is correct. LibraryID is a number around 15728640 (that was what it was when I checked just now).
The error message it gives me is simply "Cannot open AVI" with no extra help.
Any ideas?