PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Exception 0x80000002 with release version only

I get this exception only on the PocketPC release version, not on the PC release/debug versions nor on the PocketPC debug version.

Is this something to do with allignment? I've been expanding some data structures & had used some __int8 variables but I've changed these to INTs

By using displayed messages I can tell that it's after lots of values in the new data items get set but not much else.

Can anyone suggest how to debug this as the debugger does not crash???
You need to build a release build with debug info. Go into the Project settings, C++ tab, General category, and set Debug info to "Program DataBase". Then on the Link tab, General Category, select "Generate debug info". After building you will be able to debug, and get a decent idea of where the problem is at. Note that the association between the source code and the binary is not very good with this type of build, because optimizations are enabled. So at times you may step one line, and it may jump past a whole code block. Also, you may not be able to watch certain variables, since they may not really exist in the binary because of optimizations. You loose those direct ratios between source and binary.

Don't forget to disable debugging before you actually release your program.

Dan East
Conan · 09 Jun 2003, 13:01 UTC — Thanks Dan
Trying this out right now. This is the first time I have used the remote debugger but it seems to work so I should (slowly) get to the problem area.

So now I get an error ' First-chance exception in treker.exe: 0x80000002: Datatype Misalignment' so at least I have more than before though it seems to be happening in PocketFrog not my code????

back to the fray...

Taking it slowly this time it seems to be on a call to PeekMessageW in PocketFrog's main loop so my code must be doing something really odd to cause this to break :?:
Conan · 09 Jun 2003, 15:26 UTC — Oh no!, it's my bad coding again
I tracked the problem down to global variables. Some of the very last variables I added were mis-behaving.

I made them local and passed them as parameters to the relevant functions & all is working. I assume VC6 allows more space than eVC?

This leads to the question:- what controls this, heap or stack & how do I make larger?

A very interesting debug this & a reminder of why it's quicker to work on PC for most stuff though I will remember to re-compile more often to CE just to check for things like this
It's the stack. You can increase it in Project Settings, Link tab, Output Category, under Stack Allocations.

Dan East
Conan · 09 Jun 2003, 19:09 UTC — A BIG Thank You to Dan
Thanks Dan, If I look back over my sometimes painful C++ learning curve it's your name that crops up time and again as the person who solves my biggest problems.

Your help is most appreciated and if I can ever do you a favour just let me know.
No problem. It's good to save someone from some of the trial and error I've had to go through.

Dan East