WinTrans2000A
asked on
Finding Access Violation & Abstract Error
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
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
Where does the ECX value come from?
ASKER
i don't know !
This is not a function of mine, its from delphi (it's in the forms.pas file)
This is not a function of mine, its from delphi (it's in the forms.pas file)
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
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
ASKER
@marcoszorilla
This is not a function which i has written, it is from delphi (in forms.pas)
This is not a function which i has written, it is from delphi (in forms.pas)
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...
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
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
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
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
ASKER
@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 ?
@DragonSlayer
How do this work with the Stack Trace ?
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.
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.
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.
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.
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! : )
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! : )
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.