Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2007 Apr : is operator throwing exception

www.cryer.info
Managed Newsgroup Archive

is operator throwing exception

Subject:is operator throwing exception
Posted by:"Michael Zeringue" (micha..@no.smap.zclient.com)
Date:Mon, 9 Apr 2007 12:41:23

I have a case where the is operator is throwing an access violation,
something I didn't think should be possible.  Here is a snip from a
MadExcept bug report:

exception class   : EAccessViolation
exception message : Access violation at address 51F2682C in module
'rtl100.bpl'. Read of address FFFFFFDC.

main thread ($67c):
51f2682c +008 rtl100.bpl                System
TObject.InheritsFrom
51f2675e +00e rtl100.bpl                System            @IsClass
0043664e +07e ZClient32_V5.exe          MDTMain      2263 TMDT.SendMsg

Where the my last line in the call stack is:

if msg is TCLDZClientFormMsg then
    AnnounceToObservers(TCLDZClientFormMsg(msg));

I built a new VCL forms application and put a button with this event
handler on it:

procedure TForm1.Button1Click(Sender: TObject);
var
  b : TObject;
begin
  if b is TObject then
    showMessage('Is Object');
  if b is TButton then
    showMessage('IS Button');
end;

Clicking button1 shows both messages and no exceptions are thrown.  Does
anyone know what could cause 'is' to throw an access violation?

Thanks,
Michael Zeringue

Replies:

www.cryer.info
Managed Newsgroup Archive