what is the problem? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
candid_1120
Earned some good credits
Earned some good credits
Posts: 118
Joined: Sun Aug 28, 2005 8:42 am

what is the problem?

Post by candid_1120 »

I have compile the code of Ryan Norton and make the dll,but it is be crashed when I load it(click the L button of mouse);

This is the exceptional:

Debug Error!

//...

The value of ESP was not properly saved across a function a call.

This is usually a result of calling a function declared with one calling

convention with a function pointer declared with a different calling

convention
(Press Retry to debug the application)

What is that problem and how to solve it? Thanks a lot.
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Re: what is the problem?

Post by upCASE »

candid_1120 wrote:I have compile the code of Ryan Norton and make the dll,but it is be crashed when I load it(click the L button of mouse);
...
What is that problem and how to solve it? Thanks a lot.
Well, to answer your question we'd need to know what *code* you refer to. Most of us know Ryan, but I have absolutely no clue what code you are refering too.

And please post compiler version, wxWidgets version, platform, etc. as well.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Sounds like you are using stuff like cdecl (?? can be a delphi directive) or exporting the functions one way (stdcall etc) and trying to call them with reverse argument order. Which can cause a big mess.

Make sure your header file matches the way the function call is exported.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
ryanm
Earned a small fee
Earned a small fee
Posts: 10
Joined: Fri Feb 03, 2006 8:39 am

Post by ryanm »

The same error is cropping up for me constantly, too (my own project). I am building under Visual C++ 2005 Express.

The only explanations I've come across so far:
1) exception handling needs to be turned on (which it is - /EHsc)
2) structure alignment should be the same (aligning on 4-byte boundaries)
3) calling conventions should be consistent (the default __cdecl is selected for the project)

I get the error at line 105 of event.cpp:

Code: Select all

const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
    { DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) };
I have cleaned and rebuilt several times. Other libraries I'm linking against are Pthreads (Win32), Intel Performance Primitives and Boost.
ryanm
Earned a small fee
Earned a small fee
Posts: 10
Joined: Fri Feb 03, 2006 8:39 am

Post by ryanm »

Apologies for talking to myself, but I wonder if these apply:

http://support.microsoft.com/kb/822039/en-us

http://support.microsoft.com/kb/831537/en-us
Post Reply