uses DPSCAD_TLB;
var
PCsApplication : IPCsApplication;
function TMainForm.CheckConnection() : boolean;
begin
if (PCsApplication = nil) then
begin
try
{tries to connection to Automation}
PCsApplication := coApplication.Create();
result := true;
except
{connection to Automation failed}
On E:Exception do
begin
ShowMessage('Can''t connect to Automation' + #13#10 + E.ClassName +
' error raised, with message : '+E.Message);
result := false;
end;
end;
end
else
result := true;
end;
var
PCsApplication : IPCsApplication;
function TMainForm.CheckConnection() : boolean;
begin
if (PCsApplication = nil) then
begin
try
{tries to connection to Automation}
PCsApplication := coApplication.Create();
result := true;
except
{connection to Automation failed}
On E:Exception do
begin
ShowMessage('Can''t connect to Automation' + #13#10 + E.ClassName +
' error raised, with message : '+E.Message);
result := false;
end;
end;
end
else
result := true;
end;
