added workaround for not working TDataModule.AfterConstruction

git-svn-id: trunk@5733 -
This commit is contained in:
mattias 2004-08-04 10:35:38 +00:00
parent 649f11360b
commit e6ebce1af3
2 changed files with 10 additions and 2 deletions

View File

@ -1345,7 +1345,7 @@ begin
CreateNew(TheOwner,0); CreateNew(TheOwner,0);
if (ClassType <> TDataModule) and not (csDesigning in ComponentState) then if (ClassType <> TDataModule) and not (csDesigning in ComponentState) then
begin begin
if not InitResourceComponent(Self, TForm) then begin if not InitResourceComponent(Self, TDataModule) then begin
raise EResNotFound.CreateFmt(lisLCLResourceSNotFound, [ClassName]); raise EResNotFound.CreateFmt(lisLCLResourceSNotFound, [ClassName]);
end; end;
if OldCreateOrder then DoCreate; if OldCreateOrder then DoCreate;

View File

@ -1124,7 +1124,7 @@ var
ok: boolean; ok: boolean;
OldFindGlobalComponent: TFindGlobalComponent; OldFindGlobalComponent: TFindGlobalComponent;
begin begin
// Allocate the form instance, without calling the constructor // Allocate the instance, without calling the constructor
Instance := TComponent(InstanceClass.NewInstance); Instance := TComponent(InstanceClass.NewInstance);
// set the Reference before the constructor is called, so that // set the Reference before the constructor is called, so that
// events and constructors can refer to it // events and constructors can refer to it
@ -1152,6 +1152,11 @@ begin
FList.Add(TForm(Instance)); FList.Add(TForm(Instance));
end; end;
end; end;
{$IFNDEF AfterConstructionDataModuleNotWorking}
if (Instance is TDataModule) then begin
TDataModule(instance).AfterConstruction;
end;
{$ENDIF}
end; end;
function TApplication.ExecuteAction(ExeAction: TBasicAction): Boolean; function TApplication.ExecuteAction(ExeAction: TBasicAction): Boolean;
@ -1181,6 +1186,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.83 2004/08/04 10:35:38 mattias
added workaround for not working TDataModule.AfterConstruction
Revision 1.82 2004/07/25 01:04:45 mattias Revision 1.82 2004/07/25 01:04:45 mattias
TXMLPropStorage basically working TXMLPropStorage basically working