Re: Inherited Create raises an exception/access violation ? huh ?




Maarten Wiltink schreef:

"Skybuck" <skybuck2000@xxxxxxxxxxx> wrote in message
news:1151733118.018252.158400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I was just stepping through the program and I noticed how this line
causes an access violation which I find pretty strange ?

Maybe my memory is playing tricks on me... but I thought it was normal
and safe to write code like this... even if Ttest has no
predecessor/ancestor. Or could it be a new delphi feature or bug ? ;)

constructor Ttest.Create;
begin
inherited Create; // why does this cause an access violation ? ...

Every user class has a parent class. If none is specified, it defaults
to TObject.

This behaviour could be caused by calling a static constructor on
an uninitialised object (not class) reference. That seems unlikely,
but I have no other ideas - other than 'show _all_ the code'.

All the code is present. I can vaguele remember Tobject raising an
EabstractError or so... but this is different... this is an access
violation... or maybe it's more or less the same kinda strange... I'll
investigate Tobject later on ;)

Bye,
Skybuck.

.



Relevant Pages

  • Inherited Create raises an exception/access violation ? huh ?
    ... I was just stepping through the program and I noticed how this line ... causes an access violation which I find pretty strange? ... Maybe my memory is playing tricks on me... ... // why does this cause an access violation? ...
    (alt.comp.lang.borland-delphi)
  • Re: Access violation at the end of the program
    ... access violation. ... Not, while the AV itself isn't a strange thig, ... "return" the execution jumps to some strange locatin, ...
    (microsoft.public.vc.language)
  • Access violation at the end of the program
    ... access violation. ... Not, while the AV itself isn't a strange thig, ... "return" the execution jumps to some strange locatin, ...
    (microsoft.public.vc.language)
  • Does access violation address give any information?
    ... procedure TForm1.Button1Click(Sender: TObject); ... After the creation of the StringList the address of the pointer is ... When I push Button1 the pointer is freed first but not pointed to nil. ... The fact is that the Access Violation I get is "Access violation at ...
    (comp.lang.pascal.delphi.misc)
  • Re: Help button on a MessageBox
    ... gets you access violation. ... Do WINAMI MessageBox with MainForm and Application Handle, ... procedure TForm1.FormClick(Sender: TObject); ...
    (alt.comp.lang.borland-delphi)