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:
Unhandled exception at 0x0002cb80 in Lab4_2008.exe: 0xC0000005: Access violation reading location 0x0002cb80.
It is always the same memory address that is the location, and when I break out of the program it takes me to the following function:
UINT
CHapticThread::GetClosestPossiblePeriod(UINT period)
{
TIMECAPS timecaps;
MMRESULT mmRes;
mmRes = ::timeGetDevCaps( &timecaps, sizeof(TIMECAPS) );
assert(mmRes == TIMERR_NOERROR);
if ( period < timecaps.wPeriodMin )
return timecaps.wPeriodMin;
if ( period > timecaps.wPeriodMax )
return timecaps.wPeriodMax;
return period;
}
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?