![]() |
| ||
| Unhandled Exception Error I am resurrecting old code from a few years ago, and I unfortunately have little documentation as to how it was compiled and what environment it was built in. At this point, I have successfully gotten it to build, but there are errors at execution, specifically an unhandled exception error on a memory access. The error text is: Quote:
UINT Specifically, it's the call to timeGetDevCaps that is where the error occurs. I don't pretend to know all the intricacies of how pointers work - I am a mechanical engineer who has picked up some programming. However, that's the only thing that I can think of because of the association with an address. Any suggestions? |
| ||
| Re: Unhandled Exception Error well, show us your timeGetDevCaps function for start :) |
| ||
| Re: Unhandled Exception Error I think it's just this. http://msdn.microsoft.com/en-us/library/ms713416.aspx But the execution address and the read address being the same seems kinda odd to me. If that really is the case, then the code took a flying jump off a cliff (typically, following an uninitialised function pointer). The "stack" at that point is pretty much meaningless, so I wouldn't put too much store in that. Putting a breakpoint at the call, then trying "step over" would give more concrete information as to whether this was the cause, or merely the last bit of salvageable stack from the disaster which follows. |
| ||
| Re: Unhandled Exception Error Sorry, you lost me on the execution address and the read address being the same. The attempted read address is repeated twice, if that's what you are referring to, but that's what happened everywhere else I saw the error. Salem is correct - the timeGetDevCaps function is a part of the winmm.lib file, which means that I can't see the code and don't know how the constructor initializes everything. |
| ||
| Re: Unhandled Exception Error The same means this: Unhandled exception at 0x0002cb80 in Lab4_2008.exe: 0xC0000005: Access violation reading location 0x0002cb80. But did you do as I suggest, put a breakpoint on mmRes = ::timeGetDevCaps( &timecaps, sizeof(TIMECAPS) ); then step over it? It that works, then the problem is somewhere else. |
| ||
| Re: Unhandled Exception Error Well I tried putting your stuff in a standalone program and it works without any difficulties. It is possible that you have code elsewhere which is corrupting your stack, and the problem shows up when you call timeGetDevCaps. Have you considered running your code through a memory checking tool ? |
| ||
| Re: Unhandled Exception Error > Well I tried putting your stuff in a standalone program and it works without any difficulties. Yeah, tests like that pretty much nail the "it's a bug elsewhere" argument. |
| All times are GMT -4. The time now is 1:58 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC