i tried the demo (dll) and it works fine. but i need a modal dialog - so i altered the code (showModal). and it still works. now i want to load the libray, show the dialog and afterwards unload the library - all in one procedure. i alway get the same errors: "too many consecutive exceptions". the code is simple:
Code: Select all
var
AssignMyConnection: TAssignMyConnection;
ShowForm : TShowForm;
HideForms : THideForms;
hDLL : hmodule;
begin
hDLL := LoadLibrary('My_DLL.dll');
if hDLL 0 then
begin
@AssignMyConnection := GetProcAddress(hDLL, 'AssignConnection');
if @AssignMyConnection nil then
AssignMyConnection(MyConnection);
end
else
MessageDlg('Cannot load DLL', mtError, [mbOk], 0);
if hDLL 0 then
begin
@ShowForm := GetProcAddress(hDLL, 'ShowForm');
if @ShowForm nil then
ShowForm; // modal!
end;
if hDLL 0 then
begin
@HideForms := GetProcAddress(hDLL, 'HideForms');
if @HideForms nil then
HideForms;
end;
if hDLL 0 then
begin
FreeLibrary(hDLL); // exceptions!!
end;
the dll ist the same as in the demo (except that the form is modal)
what can i do? any ideas?
thanks in advance
matthias