multithreading - Inheritance problems in TThread, don't appear to work the same in D2010 as D7 -
in application have 2 thread objects (outer , sash) inherit base thread object (frameobject) of type tthread. works fine in d7. application needs extended , taking opportunity move d2010 - when try compile delphi complains frameobject create method declaration differs previous declaration.
the class types , constructors shown below;
tframeobject = class(tthread) constructor tframeobject.create(buildtype: tbuildtype; onbatchstep: tbatchnotify; onthreadcomplete: tnotifytermination); begin inherited create(true); ... end; touter = class (tframeobject) constructor create(buildtype: tbuildtype; onbatchstep: tbatchnotify; onthreadcomplete: tnotifytermination; exceptionhandler: texceptionhandler); begin inherited create(buildtype, onbatchstep, onthreadcomplete); fexceptionhandler := exceptionhandler; ... end; tsash = class (tframeobject) constructor create(buildtype: tbuildtype; onbatchstep: tbatchnotify; onthreadcomplete: tnotifytermination; exceptionhandler: texceptionhandler); begin inherited create(buildtype, onbatchstep, onthreadcomplete); fexceptionhandler := exceptionhandler; ... end;
the d2010 code direct copy of d7 source files , say, works fine in d7 (perhaps shouldn't!) - going wrong?
check types declared in multiple units 1 of them used in interface , in implementation section, example tbuildtype
in tframeobject
declaration (in interface section) resolve unita.tbuildtype
, implementation unitb.tbuildtype
.
Comments
Post a Comment