Emergence! 0xC0000005: Access Violation again [modified]
-
Hi, thomas! Thanks for your reply. I think I had found the reason. After I delete some variables that aren't be used any more, the exception is missing. But another exception is occur same as this when I use the code following:
time\_t ltime; // local time struct tm \*gmt; // Greenwich Mean Time png\_time ttime; // png format time (<ime); // get the local time---EXCEPTION 0xC0000005 OCCUR HERE! gmt = gmtime (<ime); // convert to gmt png\_convert\_from\_struct\_tm (&ttime, gmt); // convert to png format png\_set\_tIME (png\_ptr, info\_ptr, &ttime);
I trace this exception into MFC and I found when a function named _mlock was invoked in the __tzset function, the exception occur. The related code like this:
\_mlock( \_TIME\_LOCK );
I don't know the reason and hope you or others can give me some suggestion. Thank you! By the way: if the title of this message offend someone, I'm very sorry because this event is an emergency really.:mad: Regards! whiteclouds
modified on Thursday, January 1, 2009 8:20 PM
-
Hi, thomas! Thanks for your reply. I think I had found the reason. After I delete some variables that aren't be used any more, the exception is missing. But another exception is occur same as this when I use the code following:
time\_t ltime; // local time struct tm \*gmt; // Greenwich Mean Time png\_time ttime; // png format time (<ime); // get the local time---EXCEPTION 0xC0000005 OCCUR HERE! gmt = gmtime (<ime); // convert to gmt png\_convert\_from\_struct\_tm (&ttime, gmt); // convert to png format png\_set\_tIME (png\_ptr, info\_ptr, &ttime);
I trace this exception into MFC and I found when a function named _mlock was invoked in the __tzset function, the exception occur. The related code like this:
\_mlock( \_TIME\_LOCK );
I don't know the reason and hope you or others can give me some suggestion. Thank you! By the way: if the title of this message offend someone, I'm very sorry because this event is an emergency really.:mad: Regards! whiteclouds
modified on Thursday, January 1, 2009 8:20 PM
Hi, 0xC0000005 is an access or privilege violation, which means you can't access something; quite often it indicates an invalid pointer, such as NULL. It could also mean you don't have the required privileges to do something. suggestion: look at your source code, and all the variables that appear in the line that fails. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Love, happiness and fewer bugs for 2009!
-
Hi, 0xC0000005 is an access or privilege violation, which means you can't access something; quite often it indicates an invalid pointer, such as NULL. It could also mean you don't have the required privileges to do something. suggestion: look at your source code, and all the variables that appear in the line that fails. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Love, happiness and fewer bugs for 2009!
Hi I can't get your meaning. I check my code again. The address of the variable ltime is valid. All things looks like in order. But the error always occur. :( Help! Regards! whiteclouds
-
Hi I can't get your meaning. I check my code again. The address of the variable ltime is valid. All things looks like in order. But the error always occur. :( Help! Regards! whiteclouds
-
I think I had resolved this problem. My solution is to instead the time_t with SYSTEMTIME structure. Then everything looks right. Otherwise I don't know the detail of it. I think maybe this structure was obsoleted. :)
-
I think I had resolved this problem. My solution is to instead the time_t with SYSTEMTIME structure. Then everything looks right. Otherwise I don't know the detail of it. I think maybe this structure was obsoleted. :)
Glad you got it working. Thanks for sharing this. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Love, happiness and fewer bugs for 2009!