Thread View: pl.comp.lang.delphi
3 messages
3 total messages
Started by Ryszard
Fri, 15 Jun 2018 08:30
Problem z przeniesieniem komponentu z Delphi X10 na X10.1
Author: Ryszard
Date: Fri, 15 Jun 2018 08:30
Date: Fri, 15 Jun 2018 08:30
42 lines
3022 bytes
3022 bytes
witam
szukam pomocy w przeniesieniu komponentu który używam do monitorowania serwera DataSnap skompilowanego w Delphi 10.
Aktualnie jest potrzeba przeniesienia tego projektu do Delphi 10.1 no i muszę też przenieść ten komponent i tu ma problem.
Komponent został kiedyś napisany przez jednego z pracowników Embarcadero https://mathewdelong.wordpress.com/2011/11/15/datasnap-xe2-unified-connection-monitoring-sample-component/ i udostępniony na ich stronach https://cc.embarcadero.com/item/28625
Pisałem już do autora ale brak odpowiedzi, w Embarcadero już nie pracuje
Problem polega na tym że podczas próby skompilowania i instalacji komponentu w D 10.1 dostaję komunikat
[dcc32 Error] Datasnap.ServerConnectionMonitoring.pas(247): E2361 Cannot access private symbol TDSCustomServer.FComponentList
a dotyczy on poniższej linii w kodzie:
{ TDSCustomServerHack }
procedure TDSCustomServerHack.GetComponentList(const List: TDBXArrayList);
var
Index, Count: Integer;
ServerComponent: TObject;
begin
if (Self.FComponentList <> nil) and (List <> nil) then <----------------
begin
Count := Self.FComponentList.Count - 1;
for Index := 0 to Count do
begin
ServerComponent := Self.FComponentList[Index];
List.Add(ServerComponent);
end;
end;
end;
Macie może jakieś sugestie jak powinien być zmodyfikowany ten kod aby skompilował się w D 10.1 ?
Jeśli będzie potrzeba to mogę zamieścić cały listing tego modułu
Z góry dziękuję za pomoc
pozdrawiam
R
Re: Problem z przeniesieniem komponentu z Delphi X10 na X10.1
Author: Krzysztof Szyszka
Date: Fri, 15 Jun 2018 19:34
Date: Fri, 15 Jun 2018 19:34
65 lines
2915 bytes
2915 bytes
> Problem polega na tym że podczas próby skompilowania i instalacji komponentu w D 10.1 dostaję
> komunikat
>
> [dcc32 Error] Datasnap.ServerConnectionMonitoring.pas(247): E2361 Cannot access private symbol
> TDSCustomServer.FComponentList
>
> a dotyczy on poniższej linii w kodzie:
>
> { TDSCustomServerHack }
>
> procedure TDSCustomServerHack.GetComponentList(const List: TDBXArrayList);
> var
> Index, Count: Integer;
> ServerComponent: TObject;
> begin
> if (Self.FComponentList <> nil) and (List <> nil) then <----------------
> begin
> Count := Self.FComponentList.Count - 1;
> for Index := 0 to Count do
> begin
> ServerComponent := Self.FComponentList[Index];
> List.Add(ServerComponent);
> end;
> end;
> end;
>
> Macie może jakieś sugestie jak powinien być zmodyfikowany ten kod aby skompilował się w D 10.1 ?
Spróbuj wprowadzić coś takiego, jak poniżej. Nie testowałem - pisane bezpośrednio w mailu.
type
THackDSCustomServer = class(TComponent)
protected
FDbxContext: TDBXContext;
public
FStarted: Boolean;
FConfig: TDSConfiguration;
FServerMethodProvider: TDSServerMethodProvider;
FComponentList: TDBXArrayList;
FHideDSAdmin: Boolean;
end;
procedure TDSCustomServerHack.GetComponentList(const List: TDBXArrayList);
var
Index, Count: Integer;
ServerComponent: TObject;
begin
if (THackDSCustomServer(Self).FComponentList <> nil) and (List <> nil) then
begin
Count := THackDSCustomServer(Self).FComponentList.Count - 1;
for Index := 0 to Count do
begin
ServerComponent := THackDSCustomServer(Self).FComponentList[Index];
List.Add(ServerComponent);
end;
end;
end;
--
pozdrowienia
Krzysztof Szyszka, X-Files Software
Developer of X-DBGrid Component
Embarcadero Technology Partner
http://www.x-files.pl/
Re: Problem z przeniesieniem komponentu z Delphi X10 na X10.1
Author: Ryszard
Date: Mon, 18 Jun 2018 08:27
Date: Mon, 18 Jun 2018 08:27
7 lines
1893 bytes
1893 bytes
Panie Krzysztofie, bardzo dziękuję za pomoc, zaproponowane rozwiązanie zadziałało, komponent się skompilował i działa w Delphi 10.1 Co prawda wyszły nowe problemy bo np. w Delphi 10.1 datasnap inaczej niż Delphi 10 zwraca dane typu TStream, jako json a nie jako poprzednio wprost Stream, ale to już inny temat do rozwiązania pozdrawiam R
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads