Solved

Finding Access Violation & Abstract Error

Posted on 2002-03-13
12
353 Views
Last Modified: 2010-04-05
Hi, i have a big problem.
Sometimes i get AV and Abstract Error !
i don't know why, where and how !

the debug show in unit form :

function StdWndProc(Window: HWND; Message, WParam: Longint;
  LParam: Longint): Longint; stdcall; assembler;
asm
        XOR     EAX,EAX
        PUSH    EAX
        PUSH    LParam
        PUSH    WParam
        PUSH    Message
        MOV     EDX,ESP
        MOV     EAX,[ECX].Longint[4]
        CALL    [ECX].Pointer
        ADD     ESP,12            <<--- Here i get the error
        POP     EAX
end;

How can i find out where i made a mistake ?

Thanxs in advance !
Andi
0
Comment
Question by:WinTrans2000A
12 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6860060
Where does the ECX value come from?
0
 

Author Comment

by:WinTrans2000A
ID: 6860071
i don't know !
This is not a function of mine, its from delphi (it's in the forms.pas file)
0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 6860236
XOR     EAX,EAX
       PUSH    EAX
       PUSH    LParam
       PUSH    WParam
       PUSH    Message
       MOV     EDX,ESP
       MOV     EAX,[ECX].Longint[4]
       CALL    [ECX].Pointer
       ADD     ESP,12            <<--- Here i get the error
       POP     EAX

Are you sure that ESP exist
I think you are referring to SP and not to ESP.
SP is the Stack Pointer.

bye
0
 

Author Comment

by:WinTrans2000A
ID: 6860251
@marcoszorilla
This is not a function which i has written, it is from delphi (in forms.pas)
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6863239
perhaps you should do a stack trace and see what procedures are called before this? perhaps some earlier procedures messed up the registers? Just a thought...
0
 
LVL 6

Expert Comment

by:zebada
ID: 6863822
Maybe this will help:
You will get this error if your derived class, which implements its ancestor's abstract method, calls "inherited" as there is no ancestor method to be called - because it is abstract.

Regards
Paul
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 6

Expert Comment

by:zebada
ID: 6863827
One more thing:
What really bugs me is that Delphi's code generator (Ctrl-Shift-C) incorrectly inserts the "inherited" keyword into the method body even though it "knows" the method is an implementation of an abstract method. aaaarrrrrgggghhhhh.

Paul
0
 

Author Comment

by:WinTrans2000A
ID: 6863831
@zebada: This function is (it seems so) the Standard Windows Proc, which is executed for every Windows Message. I know what a abstract error is, but how can i find the code line where this error occures ?

@DragonSlayer
How do this work with the Stack Trace ?
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6864838
Hi WinTrans,

the real problem is surely not in that Delphi function, because normally this Delphi function works just fine. It must be somewhere else. Unfortunately AV exceptions are often hard to find...   :-(

If you can reproduce the error inside of the IDE, you can look at the callstack (see Delphi menu). If you can only reproduce the error outside of the IDE, you might want to try an advanced exception handling package. E.g. the one from Jedi or mine (free for non-commercial usage):

http://help.madshi.net/Data/madExcept.htm

Regards, Madshi.
0
 

Expert Comment

by:CleanupPing
ID: 9343275
WinTrans2000A:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9470751
Wow, Its been a long time since this comment have been visited!

WinTrans2000A,
No comment has been added lately (19 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: PAQ/No Refund

-- Please DO NOT accept this comment as an answer ! --

Thanks,

knightmad
EE Cleanup Volunteer

Remember you (all) can object this recommendation if you disagree, just leave a post here explaining why are you objecting and what should be done instead.
Within 7 days probably this thread will be closed, so, hurry up! : )
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9536792
This question is PAQed and no points refunded (of 100)

YensidMod
Community Support Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now