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! Regards! whiteclouds