Uso Lazarus 1.6.2 sobre windows
El procedimiento es bien largo pero voy a poner lo que creo esencial
//El error ocure si mando a ejecutar este procedimiento del modulo
procedure Tdm.IniSis();
var
f: Tforigen;
i: integer;
begin
DecimalSeparator:='.';
ThousandSeparator:=',';
ShortDateFormat := 'dd/mm/yyyy';
blnend := false;
intciclo := 0;
intfilas := 0;
intnivel := 0;
lngentidad := 0;
struser := '';
strerror := '';
for i := Screen.FormCount - 1 downto 0 do begin
if Screen.Forms.Name <> Self.Name then begin
if Screen.Forms.Name <> 'fconta' then Screen.Forms.Free;
end;
end;
for i := Screen.FormCount - 1 downto 0 do begin
if Screen.Forms.Name <> Self.Name then Screen.Forms.Free;
end;
Application.CreateForm(Tfconta, fconta);
Application.CreateForm(Tfsplash, fsplash);
fsplash.Show;
Application.ProcessMessages;
if datos() then
entrar()
else
begin
f:=Tforigen.Create(Self);
f.IniSystem:=true;
f.ShowModal;
f.Free;
if blnend then
cerrarme()
else if datos() then
begin
intciclo := intciclo + 1;
entrar()
end
else
cerrarme();
end;
end;
//Este procedimiento tambien esta en el modulo
procedure Tdm.entrar();
var
f: Tflogin;
begin
if length(struser) = 0 then struser := 'administrador';
if (cnsc.Connected or cnsch.Connected or cnos.Connected) then FinConexServer();
IniConexServer;
f:=Tflogin.Create(Self);
f.ShowModal;
f.Free;
if blnend then
cerrarme()
else
begin
fconta.lblestado.Caption := 'Listo';
fconta.Show;
fsplash.Free;
end;
end;
//Para mostrar el reporte esto esta en un formulario
if ((cbomes.ItemIndex <> 0) and ((cboent.ItemIndex <> 0) or (dm.Entidad = 0))) then
rpt.LoadFromFile(ExtractFilePath(Application.Exename) + 'balmes.lrf')
else
rpt.LoadFromFile(ExtractFilePath(Application.Exename) + 'balance.lrf');
fconta.prbestado.Position:=98;
rpt.ShowReport;