Some questions about DLL?
I TRY THE PROJECTS IN FASTREPORT|DEMOS|DLL:
CALLDLL.PRJ
RPTDLL.PRJ;
IN THIS PROJECT FUNCTIONS ARE CALL DYNAMICALLY BY WAY OF LOADLIBRARY,
I PLACE AS MANY OF ADD-IN OBJECTS AND EXPORT FILTERS AS POSSIBLE, THE EXECUTABLE FILE CALLDLL.EXE RUNS CORRECTLY, BUT I CHANGE ANOTHER WAY,
IN THE TESTDLL.PAS, I DO NOT USES DEMO'S METHOD, I JUST DEFINED AS FOLLOWED:
FUNCTION SHOWFORM: BOOL; STDCALL; EXTERNAL 'RPTDLL.DLL';[/code]function ShowForm1: Bool; StdCall; external 'rptdll.dll';
{$R *.DFM}
procedure TfrmCallDLL.btnCallDLLClick(Sender: TObject);
{var
LibHandle: THandle;
ShowForm: TShowForm;}
begin
{ LibHandle := LoadLibrary('RptDLL.DLL');
try
if LibHandle = HINSTANCE_ERROR then
raise EDLLLoadError.Create('Unable to Load DLL');
@ShowForm := GetProcAddress(LibHandle, 'ShowForm');
if not (@ShowForm = nil) then}
//
ShowForm;
//
{ finally
FreeLibrary(LibHandle);
end;}
THEN CALL THEN FUNCTION, THEN CALLDLL.EXE RUNS EXCEPTIONALLY, EXCEPTION CODE IS : FILE COULD NOT BE FOUND.
HOW TO RESOLVED THIS QUESTION?
CALLDLL.PRJ
RPTDLL.PRJ;
IN THIS PROJECT FUNCTIONS ARE CALL DYNAMICALLY BY WAY OF LOADLIBRARY,
I PLACE AS MANY OF ADD-IN OBJECTS AND EXPORT FILTERS AS POSSIBLE, THE EXECUTABLE FILE CALLDLL.EXE RUNS CORRECTLY, BUT I CHANGE ANOTHER WAY,
IN THE TESTDLL.PAS, I DO NOT USES DEMO'S METHOD, I JUST DEFINED AS FOLLOWED:
FUNCTION SHOWFORM: BOOL; STDCALL; EXTERNAL 'RPTDLL.DLL';[/code]function ShowForm1: Bool; StdCall; external 'rptdll.dll';
{$R *.DFM}
procedure TfrmCallDLL.btnCallDLLClick(Sender: TObject);
{var
LibHandle: THandle;
ShowForm: TShowForm;}
begin
{ LibHandle := LoadLibrary('RptDLL.DLL');
try
if LibHandle = HINSTANCE_ERROR then
raise EDLLLoadError.Create('Unable to Load DLL');
@ShowForm := GetProcAddress(LibHandle, 'ShowForm');
if not (@ShowForm = nil) then}
//
ShowForm;
//
{ finally
FreeLibrary(LibHandle);
end;}
THEN CALL THEN FUNCTION, THEN CALLDLL.EXE RUNS EXCEPTIONALLY, EXCEPTION CODE IS : FILE COULD NOT BE FOUND.
HOW TO RESOLVED THIS QUESTION?