procedure Tmain_form.prOfflineModuleLoad_Single(sDLLModulePath :
String);
type
TMyFormClass =
function : TFormClass;
stdcall;
TSQLiteFileConnection =
procedure(SQLiteFileConnection : TUniConnection);
stdcall;
TSQLiteMemoryConnection =
procedure(SQLiteMemoryConnection : TUniConnection);
stdcall;
TParms =
procedure(Language, UserSewingPlant, UserEANCheckPlantID :
String)
stdcall;
var
i : Integer;
lMyFormClass : TMyFormClass;
lSQLiteFileConnection : TSQLiteFileConnection;
lSQLiteMemoryConnection : TSQLiteMemoryConnection;
lParms : TParms;
begin
//Define Variables
gsDLL := sDLLModulePath;
hDLL := LoadLibrary(PChar(gsDLL));
gblDLLLoaded := True;
//SQLite File Connection
lSQLiteFileConnection := GetProcAddress(hDLL, '
prSQLiteFileConnect');
If Assigned (lSQLiteFileConnection)
Then
Begin
lSQLiteFileConnection(dmsqlite.SQLiteFile);
End;
//SQLite Memory Connection
lSQLiteMemoryConnection := GetProcAddress(hDLL, '
prSQLiteMemoryConnect');
If Assigned (lSQLiteMemoryConnection)
Then
Begin
lSQLiteMemoryConnection(dmsqlite.SQLiteMemory);
End;
//Parameters
lParms := GetProcAddress(hDLL, '
prModuleParameters');
If Assigned (lParms)
Then
Begin
lParms(gsPSTLanguage, gsPSTUserSewingPlant, gsPSTUserEANCheckPlantID);
End;
//Load DLL Form
lMyFormClass := GetProcAddress(hDLL, '
fnForm');
If @lMyFormClass <>
Nil Then
Begin
frmLoadedForm := lMyFormClass.Create(
nil);
frmLoadedForm.Position := poScreenCenter;
frmLoadedForm.ShowModal;
End Else
Begin
fnDisplayMyActionBox('
ERR', '
System Error', '
prOfflineModuleLoad_Single', '
Could not load Module:', sDLLModulePath, EmptyStr, True);
End;
end;