MIDAS + DAO + THREAD

alda

Member
hi
I need reading function from server
function GetAlert: WideString; safecall;
(...DmSPAD1.OSession_kotace.DBMS_Alert.WaitAny(gs_alert,gs_zprava,gi_status,5)...)

If I reading from clint (thread) this functions arising exception
EVariantError with error message: Variant is not an array. Why. Thanks Alda
 
Is it the WaitAny function that raises this exception?

------------------
Marco Kalter
Allround Automations
 
I want read alerts from Server

OSession_kotace.DBMS_Alert.Register('X20552');

I use this thread:

unit vlaknoRefresh;

interface

uses
Classes, dbClient, ScktComp, SConnect, forms, StdCtrls;

type
TThreadRefresh = class(TThread)
private
{ Private declarations }
fRefresh: Boolean;
fPopis: string;
fLabelPopis: TLabel;
fTConnectionBroker: TConnectionBroker;

protected
procedure Execute; override;
published
constructor Create(_ConBroker:TConnectionBroker; _Refresh: Boolean; _Popis: Tlabel);
end;

implementation

uses Global, activeX;

{ TThreadRefresh }

constructor TThreadRefresh.Create(_ConBroker:TConnectionBroker;_Refresh: Boolean; _Popis: TLabel);
begin
inherited Create(true); // Create thread suspended
fRefresh:= _Refresh;
// fPopis:= _Popis;
fLabelPopis:= _Popis;
fTConnectionBroker:= _ConBroker;
Priority:= tpNormal;
FreeOnTerminate:= true;
Suspended := false;
fLabelPopis.Caption:= fTConnectionBroker.appserver.getalert;
end;

procedure TThreadRefresh.Execute;
begin
CoInitialize(nil);
while (not Terminated) and (fTConnectionBroker.Connected) do
begin
fLabelPopis.Caption:= fTConnectionBroker.appserver.getalert;
 
Back
Top