deactivated FCL TDataModule

git-svn-id: trunk@4408 -
This commit is contained in:
mattias 2003-07-14 09:03:39 +00:00
parent 9d4d13de9c
commit c4156a9592
6 changed files with 104 additions and 86 deletions

View File

@ -43,9 +43,9 @@ uses
type type
// TJITForm is a template TForm descendent class that can be altered at // TJITForm is a template TForm descendent class that can be altered at
// runtime // runtime
TJITForm = class (TForm) TJITForm = class(TForm)
protected protected
class function NewInstance : TObject; override; class function NewInstance: TObject; override;
public public
end; end;
@ -54,9 +54,9 @@ type
// TJITDataModule is a template TDataModule descendent class that can be // TJITDataModule is a template TDataModule descendent class that can be
// altered at runtime // altered at runtime
TJITDataModule = class (TDataModule) TJITDataModule = class(TDataModule)
protected protected
class function NewInstance : TObject; override; class function NewInstance: TObject; override;
procedure ValidateRename(AComponent: TComponent; procedure ValidateRename(AComponent: TComponent;
const CurName, NewName: string); override; const CurName, NewName: string); override;
public public
@ -72,6 +72,8 @@ type
procedure DoNothing; procedure DoNothing;
end; end;
TJITClass = class of TPersistent;
implementation implementation
@ -89,14 +91,6 @@ begin
AComponent.SetDesigning(Value); AComponent.SetDesigning(Value);
end; end;
{ TJITForm }
function TJITForm.NewInstance: TObject;
begin
Result:=inherited NewInstance;
TSetDesigningComponent.SetDesigningOfControl(TComponent(Result),true);
end;
{ TPersistentWithTemplates } { TPersistentWithTemplates }
procedure TPersistentWithTemplates.DoNothing; procedure TPersistentWithTemplates.DoNothing;
@ -105,6 +99,14 @@ begin
// !!! do not write any code in here !!! // !!! do not write any code in here !!!
end; end;
{ TJITForm }
function TJITForm.NewInstance: TObject;
begin
Result:=inherited NewInstance;
TSetDesigningComponent.SetDesigningOfControl(TComponent(Result),true);
end;
{ TJITDataModule } { TJITDataModule }
function TJITDataModule.NewInstance: TObject; function TJITDataModule.NewInstance: TObject;

View File

@ -39,6 +39,8 @@ unit JITForms;
{$I ide.inc} {$I ide.inc}
{ $DEFINE VerboseJITForms}
interface interface
uses uses
@ -89,10 +91,10 @@ type
procedure FreevmtCopy(vmtCopy: Pointer); procedure FreevmtCopy(vmtCopy: Pointer);
procedure DoAddNewMethod(JITClass:TClass; procedure DoAddNewMethod(JITClass:TClass;
const AName:ShortString; ACode:Pointer); const AName:ShortString; ACode:Pointer);
// AddNewMethod does not check if method already exists // Note: AddNewMethod does not check if method already exists
procedure DoRemoveMethod(JITClass:TClass; AName:ShortString; procedure DoRemoveMethod(JITClass:TClass; AName:ShortString;
var OldCode:Pointer); var OldCode:Pointer);
// RemoveMethod does not free code memory // Note: RemoveMethod does not free code memory
procedure DoRenameMethod(JITClass:TClass; OldName,NewName:ShortString); procedure DoRenameMethod(JITClass:TClass; OldName,NewName:ShortString);
procedure DoRenameClass(JITClass:TClass; const NewName:ShortString); procedure DoRenameClass(JITClass:TClass; const NewName:ShortString);
// TReader events // TReader events
@ -146,6 +148,7 @@ type
BinStream: TStream; ComponentClass: TComponentClass; BinStream: TStream; ComponentClass: TComponentClass;
ParentControl: TWinControl): TComponent; ParentControl: TWinControl): TComponent;
public public
BaseJITClass: TJITClass;
property OnReaderError: TJITReaderErrorEvent property OnReaderError: TJITReaderErrorEvent
read FOnReaderError write FOnReaderError; read FOnReaderError write FOnReaderError;
property CurReadJITComponent:TComponent read FCurReadJITComponent; property CurReadJITComponent:TComponent read FCurReadJITComponent;
@ -164,7 +167,6 @@ type
private private
function GetItem(Index: integer): TForm; function GetItem(Index: integer): TForm;
protected protected
procedure DoFinishReading; override;
function CreateDefaultVMTCopy: Pointer; override; function CreateDefaultVMTCopy: Pointer; override;
public public
constructor Create; constructor Create;
@ -305,11 +307,11 @@ end;
function TJITComponentList.AddNewJITComponent:integer; function TJITComponentList.AddNewJITComponent:integer;
var NewComponentName,NewClassName:shortstring; var NewComponentName,NewClassName:shortstring;
begin begin
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
Writeln('[TJITComponentList] AddNewJITComponent'); Writeln('[TJITComponentList] AddNewJITComponent');
{$ENDIF} {$ENDIF}
GetUnusedNames(NewComponentName,NewClassName); GetUnusedNames(NewComponentName,NewClassName);
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
Writeln('NewComponentName is ',NewComponentName,', NewClassName is ',NewClassName); Writeln('NewComponentName is ',NewComponentName,', NewClassName is ',NewClassName);
{$ENDIF} {$ENDIF}
Result:=DoCreateJITComponent(NewComponentName,NewClassName); Result:=DoCreateJITComponent(NewComponentName,NewClassName);
@ -332,18 +334,18 @@ begin
exit; exit;
end; end;
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITFormFromStream] 1'); writeln('[TJITComponentList.AddJITComponentFromStream] Create ...');
{$ENDIF} {$ENDIF}
try try
Result:=DoCreateJITComponent('',NewClassName); Result:=DoCreateJITComponent('',NewClassName);
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITFormFromStream] 2'); writeln('[TJITComponentList.AddJITComponentFromStream] InitReading ...');
{$ENDIF} {$ENDIF}
InitReading(BinStream,Reader); InitReading(BinStream,Reader);
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITFormFromStream] 3'); writeln('[TJITComponentList.AddJITComponentFromStream] Read ...');
{$ENDIF} {$ENDIF}
try try
Reader.ReadRootComponent(FCurReadJITComponent); Reader.ReadRootComponent(FCurReadJITComponent);
@ -354,8 +356,8 @@ begin
FCurReadJITComponent.Name:=NewName; FCurReadJITComponent.Name:=NewName;
end; end;
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITFormFromStream] 5'); writeln('[TJITComponentList.AddJITComponentFromStream] Finish Reading ...');
{$ENDIF} {$ENDIF}
DoFinishReading; DoFinishReading;
finally finally
@ -385,7 +387,7 @@ begin
MyFindGlobalComponentProc:=@OnFindGlobalComponent; MyFindGlobalComponentProc:=@OnFindGlobalComponent;
FindGlobalComponent:=@MyFindGlobalComponent; FindGlobalComponent:=@MyFindGlobalComponent;
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.InitReading] A'); writeln('[TJITComponentList.InitReading] A');
{$ENDIF} {$ENDIF}
// connect TReader events // connect TReader events
@ -397,7 +399,7 @@ begin
Reader.OnCreateComponent:=@ReaderCreateComponent; Reader.OnCreateComponent:=@ReaderCreateComponent;
Reader.OnFindComponentClass:=@ReaderFindComponentClass; Reader.OnFindComponentClass:=@ReaderFindComponentClass;
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.InitReading] B'); writeln('[TJITComponentList.InitReading] B');
{$ENDIF} {$ENDIF}
@ -452,6 +454,9 @@ procedure TJITComponentList.RemoveMethod(JITComponent:TComponent;
const AName:ShortString); const AName:ShortString);
var OldCode:Pointer; var OldCode:Pointer;
begin begin
{$IFDEF VerboseJITForms}
writeln('TJITComponentList.RemoveMethod ',JITComponent.Name,':',JITComponent.Name,' Method=',AName);
{$ENDIF}
if JITComponent=nil then if JITComponent=nil then
raise Exception.Create('TJITComponentList.RemoveMethod JITComponent=nil'); raise Exception.Create('TJITComponentList.RemoveMethod JITComponent=nil');
if IndexOf(JITComponent)<0 then if IndexOf(JITComponent)<0 then
@ -467,6 +472,9 @@ end;
procedure TJITComponentList.RenameMethod(JITComponent:TComponent; procedure TJITComponentList.RenameMethod(JITComponent:TComponent;
const OldName,NewName:ShortString); const OldName,NewName:ShortString);
begin begin
{$IFDEF VerboseJITForms}
writeln('TJITComponentList.RenameMethod ',JITComponent.Name,':',JITComponent.Name,' Old=',OldName,' NewName=',NewName);
{$ENDIF}
if JITComponent=nil then if JITComponent=nil then
raise Exception.Create('TJITComponentList.RenameMethod JITComponent=nil'); raise Exception.Create('TJITComponentList.RenameMethod JITComponent=nil');
if IndexOf(JITComponent)<0 then if IndexOf(JITComponent)<0 then
@ -480,6 +488,9 @@ end;
procedure TJITComponentList.RenameComponentClass(JITComponent:TComponent; procedure TJITComponentList.RenameComponentClass(JITComponent:TComponent;
const NewName:ShortString); const NewName:ShortString);
begin begin
{$IFDEF VerboseJITForms}
writeln('TJITComponentList.RenameComponentClass ',JITComponent.Name,':',JITComponent.Name,' New=',NewName);
{$ENDIF}
if JITComponent=nil then if JITComponent=nil then
raise Exception.Create('TJITComponentList.RenameComponentClass JITComponent=nil'); raise Exception.Create('TJITComponentList.RenameComponentClass JITComponent=nil');
if IndexOf(JITComponent)<0 then if IndexOf(JITComponent)<0 then
@ -501,12 +512,12 @@ begin
NewComponent:=nil; NewComponent:=nil;
if IndexOf(JITOwnerComponent)<0 then if IndexOf(JITOwnerComponent)<0 then
RaiseException('TJITComponentList.AddJITChildComponentFromStream'); RaiseException('TJITComponentList.AddJITChildComponentFromStream');
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITChildComponentFromStream] A'); writeln('[TJITComponentList.AddJITChildComponentFromStream] A');
{$ENDIF} {$ENDIF}
try try
InitReading(BinStream,Reader); InitReading(BinStream,Reader);
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITChildComponentFromStream] B'); writeln('[TJITComponentList.AddJITChildComponentFromStream] B');
{$ENDIF} {$ENDIF}
try try
@ -514,7 +525,7 @@ begin
FCurReadClass:=JITOwnerComponent.ClassType; FCurReadClass:=JITOwnerComponent.ClassType;
FFlags:=FFlags+[jclAutoRenameComponents]; FFlags:=FFlags+[jclAutoRenameComponents];
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITChildComponentFromStream] C1 ',ComponentClass.ClassName); writeln('[TJITComponentList.AddJITChildComponentFromStream] C1 ',ComponentClass.ClassName);
{$ENDIF} {$ENDIF}
Reader.Root := FCurReadJITComponent; Reader.Root := FCurReadJITComponent;
@ -530,7 +541,7 @@ begin
end; end;
writeln('[TJITComponentList.AddJITChildComponentFromStream] C6 '); writeln('[TJITComponentList.AddJITChildComponentFromStream] C6 ');
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.AddJITChildComponentFromStream] D'); writeln('[TJITComponentList.AddJITChildComponentFromStream] D');
{$ENDIF} {$ENDIF}
DoFinishReading; DoFinishReading;
@ -553,6 +564,9 @@ var CodeTemplate,NewCode:Pointer;
CodeSize:integer; CodeSize:integer;
OldCode: Pointer; OldCode: Pointer;
begin begin
{$IFDEF VerboseJITForms}
writeln('TJITComponentList.CreateNewMethod ',JITComponent.Name,':',JITComponent.Name,' Method=',AName);
{$ENDIF}
if JITComponent=nil then if JITComponent=nil then
raise Exception.Create('TJITComponentList.CreateNewMethod JITComponent=nil'); raise Exception.Create('TJITComponentList.CreateNewMethod JITComponent=nil');
if IndexOf(JITComponent)<0 then if IndexOf(JITComponent)<0 then
@ -602,7 +616,7 @@ end;
function TJITComponentList.CreateVMTCopy(SourceClass:TClass; function TJITComponentList.CreateVMTCopy(SourceClass:TClass;
const NewClassName:ShortString):Pointer; const NewClassName:ShortString):Pointer;
const const
vmtSize:integer=2000; //XXX how big is the vmt of class TJITForm ? vmtSize:integer=5000; //XXX how big is the vmt of class TJITForm ?
var MethodTable, NewMethodTable : PMethodNameTable; var MethodTable, NewMethodTable : PMethodNameTable;
MethodTableSize: integer; MethodTableSize: integer;
ClassNamePtr, ClassNamePShortString: Pointer; ClassNamePtr, ClassNamePShortString: Pointer;
@ -639,7 +653,7 @@ procedure TJITComponentList.FreevmtCopy(vmtCopy:Pointer);
CurMethod: TMethodNameRec; CurMethod: TMethodNameRec;
begin begin
if MethodTable=nil then exit; if MethodTable=nil then exit;
BaseMethodTable:=PMethodNameTable((Pointer(TJITForm)+vmtMethodTable)^); BaseMethodTable:=PMethodNameTable((Pointer(BaseJITClass)+vmtMethodTable)^);
if Assigned(BaseMethodTable) then if Assigned(BaseMethodTable) then
BaseCount:=BaseMethodTable^.Count BaseCount:=BaseMethodTable^.Count
else else
@ -661,7 +675,9 @@ var
MethodTable : PMethodNameTable; MethodTable : PMethodNameTable;
ClassNamePtr: Pointer; ClassNamePtr: Pointer;
begin begin
//writeln('[TJITComponentList.FreevmtCopy] ClassName='''+TClass(vmtCopy).ClassName+''''); {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.FreevmtCopy] ClassName='''+TClass(vmtCopy).ClassName+'''');
{$ENDIF}
if vmtCopy=nil then exit; if vmtCopy=nil then exit;
// free copy of methodtable // free copy of methodtable
MethodTable:=PMethodNameTable((Pointer(vmtCopy)+vmtMethodTable)^); MethodTable:=PMethodNameTable((Pointer(vmtCopy)+vmtMethodTable)^);
@ -717,11 +733,12 @@ end;
procedure TJITComponentList.DoRemoveMethod(JITClass:TClass; procedure TJITComponentList.DoRemoveMethod(JITClass:TClass;
AName:ShortString; var OldCode:Pointer); AName:ShortString; var OldCode:Pointer);
// Note: does not free OldCode
var OldMethodTable, NewMethodTable: PMethodNameTable; var OldMethodTable, NewMethodTable: PMethodNameTable;
NewMethodTableSize:integer; NewMethodTableSize:integer;
a:cardinal; a:cardinal;
begin begin
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.DoRemoveMethod] '''+JITClass.ClassName+'.'+AName+''''); writeln('[TJITComponentList.DoRemoveMethod] '''+JITClass.ClassName+'.'+AName+'''');
{$ENDIF} {$ENDIF}
AName:=uppercase(AName); AName:=uppercase(AName);
@ -739,8 +756,8 @@ begin
OldMethodTable^.Count*SizeOf(TMethodNameRec); OldMethodTable^.Count*SizeOf(TMethodNameRec);
GetMem(NewMethodTable,NewMethodTableSize); GetMem(NewMethodTable,NewMethodTableSize);
NewMethodTable^.Count:=OldMethodTable^.Count-1; NewMethodTable^.Count:=OldMethodTable^.Count-1;
Move(OldMethodTable^,NewMethodTable^,SizeOf(DWord)+ Move(OldMethodTable^,NewMethodTable^,
a*SizeOf(TMethodNameRec)); SizeOf(DWord)+a*SizeOf(TMethodNameRec));
Move(OldMethodTable^.Entries[a],NewMethodTable^.Entries[a+1], Move(OldMethodTable^.Entries[a],NewMethodTable^.Entries[a+1],
SizeOf(DWord)+a*SizeOf(TMethodNameRec)); SizeOf(DWord)+a*SizeOf(TMethodNameRec));
end else begin end else begin
@ -761,7 +778,7 @@ procedure TJITComponentList.DoRenameMethod(JITClass:TClass;
var MethodTable: PMethodNameTable; var MethodTable: PMethodNameTable;
a:integer; a:integer;
begin begin
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.DoRenameMethod] ClassName='''+JITClass.ClassName+'''' writeln('[TJITComponentList.DoRenameMethod] ClassName='''+JITClass.ClassName+''''
+' OldName='''+OldName+''' NewName='''+OldName+''''); +' OldName='''+OldName+''' NewName='''+OldName+'''');
{$ENDIF} {$ENDIF}
@ -778,7 +795,7 @@ end;
procedure TJITComponentList.DoRenameClass(JITClass:TClass; procedure TJITComponentList.DoRenameClass(JITClass:TClass;
const NewName:ShortString); const NewName:ShortString);
begin begin
{$IFDEF IDE_VERBOSE} {$IFDEF VerboseJITForms}
writeln('[TJITComponentList.DoRenameClass] OldName='''+JITClass.ClassName writeln('[TJITComponentList.DoRenameClass] OldName='''+JITClass.ClassName
+''' NewName='''+NewName+''' '); +''' NewName='''+NewName+''' ');
{$ENDIF} {$ENDIF}
@ -924,6 +941,7 @@ constructor TJITForms.Create;
begin begin
inherited Create; inherited Create;
FComponentPrefix:='Form'; FComponentPrefix:='Form';
BaseJITClass:=TJITForm;
end; end;
function TJITForms.IsJITForm(AComponent: TComponent): boolean; function TJITForms.IsJITForm(AComponent: TComponent): boolean;
@ -942,32 +960,6 @@ begin
Result:=CreateVMTCopy(TJITForm,'TJITForm'); Result:=CreateVMTCopy(TJITForm,'TJITForm');
end; end;
procedure TJITForms.DoFinishReading;
{ procedure ApplyVisible;
var
i: integer;
AControl: TControl;
begin
// The LCL has as default Visible=false. But for Delphi compatibility
// loading control defaults to true.
for i:=0 to FCurReadJITComponent.ComponentCount-1 do begin
AControl:=TControl(FCurReadJITComponent.Components[i]);
if (AControl is TControl) then begin
if (not (csVisibleSetInLoading in AControl.ControlState)) then
AControl.Visible:=true
else
AControl.ControlState:=
AControl.ControlState-[csVisibleSetInLoading];
end;
end;
end;}
begin
inherited DoFinishReading;
//ApplyVisible;
end;
{ TJITDataModules } { TJITDataModules }
@ -985,6 +977,7 @@ constructor TJITDataModules.Create;
begin begin
inherited Create; inherited Create;
FComponentPrefix:='DataModule'; FComponentPrefix:='DataModule';
BaseJITClass:=TJITDataModule;
end; end;
function TJITDataModules.IsJITDataModule(AComponent: TComponent): boolean; function TJITDataModules.IsJITDataModule(AComponent: TComponent): boolean;

View File

@ -86,8 +86,11 @@ implementation
function FindPackagesTemplate: TDefineTemplate; function FindPackagesTemplate: TDefineTemplate;
begin begin
if (CodeToolBoss<>nil) then
Result:=CodeToolBoss.DefineTree.FindDefineTemplateByName( Result:=CodeToolBoss.DefineTree.FindDefineTemplateByName(
PackagesDefTemplName,true); PackagesDefTemplName,true)
else
Result:=nil;
end; end;
function FindPackageTemplateWithID(const PkgID: string): TDefineTemplate; function FindPackageTemplateWithID(const PkgID: string): TDefineTemplate;
@ -103,8 +106,11 @@ end;
function FindCurrentProjectTemplate: TDefineTemplate; function FindCurrentProjectTemplate: TDefineTemplate;
begin begin
if (CodeToolBoss<>nil) then
Result:=CodeToolBoss.DefineTree.FindDefineTemplateByName( Result:=CodeToolBoss.DefineTree.FindDefineTemplateByName(
ProjectDefTemplName,true); ProjectDefTemplName,true)
else
Result:=nil;
end; end;
function CreateProjectTemplate(var ProjectDirTemplate: TDefineTemplate function CreateProjectTemplate(var ProjectDirTemplate: TDefineTemplate
@ -113,8 +119,12 @@ var
ProjectDir, ProjectSrcPath, ProjectIncPath, ProjectDir, ProjectSrcPath, ProjectIncPath,
ProjectUnitPath: TDefineTemplate; ProjectUnitPath: TDefineTemplate;
begin begin
if (CodeToolBoss=nil) then begin
Result:=nil;
exit;
end;
Result:=FindCurrentProjectTemplate; Result:=FindCurrentProjectTemplate;
if Result<>nil then begin if (Result<>nil) then begin
ProjectDirTemplate:=Result.FindChildByName(ProjectDirDefTemplName); ProjectDirTemplate:=Result.FindChildByName(ProjectDirDefTemplName);
exit; exit;
end; end;

View File

@ -883,6 +883,8 @@ begin
// free project, if it is still there // free project, if it is still there
FreeThenNil(Project1); FreeThenNil(Project1);
// free IDE parts
FreeThenNil(FormEditor1); FreeThenNil(FormEditor1);
FreeThenNil(PkgBoss); FreeThenNil(PkgBoss);
FreeThenNil(GlobalDesignHook); FreeThenNil(GlobalDesignHook);
@ -890,6 +892,7 @@ begin
FreeThenNil(HiddenWindowsOnRun); FreeThenNil(HiddenWindowsOnRun);
FreeThenNil(TheOutputFilter); FreeThenNil(TheOutputFilter);
FreeThenNil(MacroList); FreeThenNil(MacroList);
// IDE options objects
FreeThenNil(CodeToolsOpts); FreeThenNil(CodeToolsOpts);
FreeThenNil(MiscellaneousOptions); FreeThenNil(MiscellaneousOptions);
FreeThenNil(EditorOpts); FreeThenNil(EditorOpts);
@ -9351,6 +9354,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.624 2003/07/14 09:03:39 mattias
deactivated FCL TDataModule
Revision 1.623 2003/07/12 09:11:28 mattias Revision 1.623 2003/07/12 09:11:28 mattias
updated build scripts updated build scripts

View File

@ -2589,6 +2589,7 @@ end;
procedure TProjectDefineTemplates.Clear; procedure TProjectDefineTemplates.Clear;
begin begin
if FMain<>nil then begin if FMain<>nil then begin
if CodeToolBoss<>nil then
CodeToolBoss.DefineTree.RemoveDefineTemplate(FMain); CodeToolBoss.DefineTree.RemoveDefineTemplate(FMain);
FMain:=nil; FMain:=nil;
FProjectDir:=nil; FProjectDir:=nil;
@ -2667,6 +2668,9 @@ end.
{ {
$Log$ $Log$
Revision 1.132 2003/07/14 09:03:39 mattias
deactivated FCL TDataModule
Revision 1.131 2003/07/08 17:30:19 mattias Revision 1.131 2003/07/08 17:30:19 mattias
fixed changing widget set and TStringGrid exceptions on ColCount=0 fixed changing widget set and TStringGrid exceptions on ColCount=0

View File

@ -34,8 +34,10 @@ interface
{$ASSERTIONS ON} {$ASSERTIONS ON}
{$endif} {$endif}
{$IFDEF VER1_0_8 or VER1_0_10} {$IF VER1_0_8 or VER1_0_10}
{$DEFINE UseFCLDataModule} // There is a problem with try..except and calling JIT procedures, so we can't
// use the FCL TDataModule at the moment
{ $DEFINE UseFCLDataModule}
{$ENDIF} {$ENDIF}
uses uses
@ -1201,26 +1203,27 @@ end;
procedure TDataModule.DoCreate; procedure TDataModule.DoCreate;
begin begin
if Assigned(FOnCreate) then if Assigned(FOnCreate) then
try //try
FOnCreate(Self); FOnCreate(Self);
except {except
begin begin
if not HandleCreateException then if not HandleCreateException then
raise; raise;
end; end;
end; end;}
end; end;
procedure TDataModule.DoDestroy; procedure TDataModule.DoDestroy;
begin begin
if Assigned(FOnDestroy) then if Assigned(FOnDestroy) then begin
try //try
FOnDestroy(Self); FOnDestroy(Self);
except {except
begin begin
if Assigned(ApplicationHandleException) then if Assigned(ApplicationHandleException) then
ApplicationHandleException(Self); ApplicationHandleException(Self);
end; end;
end;}
end; end;
end; end;