More and more and uglier and uglier.....
I opened the original project, it has a datamodule with one zconnection and one zquery. Could set the zquery active bit.
Compiled clean.
Program crashes as it starts up.
Stepped through startup code, crashing on
Application.CreateForm(TDM, DM);
This is the datamodule. I have no code in this module.
Removed zconnection and zquery, compile and run OK.
Added zconnection, connected to database, compile and run OK.
Added zquery, attached it to zconnection, added sql, compile and run OK.
Set zquery to ACTIVE, compile and run. Crashes in the following code (module application.inc, line 1943) at line 1960:
procedure TApplication.CreateForm(InstanceClass: TComponentClass;
out Reference);
var
Instance: TComponent;
ok: boolean;
AForm: TForm;
begin
// Allocate the instance, without calling the constructor
Instance := TComponent(InstanceClass.NewInstance);
// set the Reference before the constructor is called, so that
// events and constructors can refer to it
TComponent(Reference) := Instance;
ok:=false;
try
if (FCreatingForm=nil) and (Instance is TForm) then
FCreatingForm:=TForm(Instance);
Instance.Create(Self); <<<<< STOPS HERE 1960 >>>>>>>>
ok:=true;
finally
if not ok then begin
TComponent(Reference) := nil;
if FCreatingForm=Instance then
FCreatingForm:=nil;
end;
end;
Closed project. Quit lazarus.
Restarted Lazarus, opened project, tried to set the active bit on the zquery, woops access violation again.....
Help, Ian