You are not logged in.
Pages: 1
Client Program
fClient := TSQLHttpClient.Create('localhost','888',fModel);
How to forward "fClient" to BPL?
BPL ładowany poprzez LoadPackage(PChar(FileName));
Or Which plug-in model to choose to leave the small main application (menu + loading plugins) and transfer the rest to BPL or dll plugins
Offline
Konsul41, your question does not concern exact mORMot but general working with libraries. This is too complicated to give a precise answer, we need to understand entire application structure and your expectations. Usually you can pass any data through exported stcall methods (dll)
ps. (polish)
Kolego, pisz po angielsku: "BPL ładowany poprzez".
Offline
OKAY.
Google translator.
My program is a bit of a mix of technologies
// A factory that supports all plugins
IObjectFactory = interface
['{05C782E6-7DE7-46B4-82E0-22A5A64BEDB2}']
procedure RegisterFactoryDriver(driver: IObjectFactoryDriver);
procedure UnRegisterFactoryDriver(driver: IObjectFactoryDriver);
function MakeNew(id: WideString): IUnknown;
procedure Clear;
function GetClient(): TSQLRestClientURI;
procedure SetClient(const Value: TSQLRestClientURI);
function UdostepnijKlienta(): TSQLRestClientURI;
end;
procedure TObiekt.Exec(Sender: TObject);
var
client : TSQLRestClientURI;
aResponse,
RawBate : RawUTF8;
Lekarz : TLekarz;
begin
client:=fabryka.GetClient; //fabryka : IObjectFactory;
client.CallBackGet('Eat',[],aResponse);
Client.CallBackGet('GetFile',['filename','20200514_204819.jpg'],RawUTF8(RawBate));
Lekarz:=TLekarz.Create;
try
Client.Model.AddTable(TLekarz);
Client.Retrieve(1,Lekarz);
ShowMessage('Imię i nazwisko Lekarza '+Lekarz.imie+' '+Lekarz.nazwisko);
finally
Lekarz.Free;
end;
Client.CallBackGet('Eat',[],aResponse);
end;
This function is connected with BPL to the main program menu and it works
the question concerns the mormot and the method of transmission
client: TSQLRestClientURI;
to bpl
is such a way safe or should it be done differently?
The question is because passing the client to BPL I lose tables from the model and I have to add
Client.Model.AddTable (TLekarz);
Last edited by konsul41 (2020-05-27 12:18:57)
Offline
I thought it was the operation of the menu.
No, that's not it.
I cleared all bpl of everything
i only do
LoadPackage
and
ModuleName: = ExtractFileName (getModuleName (BPLeMAIN [Length (BPLeMAIN)-1]));
UnloadPackage (BPLeMAIN [Length (BPLeMAIN)-1]);
modulename contains a valid file name
and I can only release the first BPL, and 2 and 3 not. I suppose all the following ones (which will be at all) cause the error "Invalid Package handle"
Can anyone verify this?
Last edited by konsul41 (2020-05-27 19:11:13)
Offline
Pages: 1