You are not logged in.
Pages: 1
I'm using a `TSQLRestServerFullMemory` object, and a service that will internally use MSXML. I'm getting this error:
Debug Output:
onecore\com\combase\objact\objact.cxx(827)\combase.dll!767FF2A9: (caller: 767FE1DB) ReturnHr(20) tid(3664) 800401F0 CoInitialize has not been called.
Where should I call CoInitialize / CoUnitialize methods in my server?
Offline
By the way, I just called CoInitialize() in the service method itself, as repeated calls in the same thread should not do anything extra, according to some guy on the internet. Is this right?
Offline
Do you mean, overloading those methods in a descendant class?
TMyRestServer = class(TSQLRestServerFullMemory)
protected
procedure BeginCurrentThread(Sender: TThread); override;
procedure EndCurrentThread(Sender: TThread); override;
end;
procedure TMyRestServer.BeginCurrentThread(Sender: TThread);
begin
inherited;
CoInitialize(nil);
end;
procedure TMyRestServer.EndCurrentThread(Sender: TThread);
begin
CoUninitialize;
inherited;
end;
Last edited by leus (2020-12-09 17:08:43)
Offline
Pages: 1