Program in Windows XP and Windows7 32 system run well, today installed a Windows7 64-bit system (note, the program itself or 32-bit developed), the runtime appears "0XC015000F is being deactivated activation context is not recently activated" this error, After looking for a long time to solve, the following summary is as follows:
There are more methods on the web that use Afxambientactctx = FALSE after calling cwinapp::initinstance (); I do not have this problem when I adopt this method. However, there are some code in my program because the variable is set to False, resulting in no execution, so there are other problems, so give up the method.
The way I do this is to throw all the MFC exceptions in Debug and not allow MFC to handle the exception, so that it does not cause crash, as follows: In VS2008, the "Debug" menu-> "exceptions"-> "Win32 exceptions", Then throw these exceptions all on the check. But that should also throw out other exceptions, such as memory crossing the line. Your code is best measured on other machines to handle these anomalies.
When I make a mistake, it's like this:
This should be "Strrecord.format" ("%04d-%02d-%02d%02d:%02d:%02d%s", Systime.wyear, Systime.wmonth, Systime.wday, SysTime.wHour, Systime.wminute, Systime.wsecond, pstatus); ”
Accidentally written "Strrecord.format ("%s ", Systime.wyear, Systime.wmonth, Systime.wday, Systime.whour, Systime.wminute, Systime.wsecond, pstatus); ”
This prompts the above error.
The error of seeing someone on the internet is as follows:
scanf ("%d,%d,&a,&b")
Change into
scanf ("%d,%d", &a,&b)
Namely: this should be scanf ("%d,%d", &a,&b) The result is written scanf ("%d,%d,&a,&b").
In VS2010, the Debug menu-> "Exceptions"-> "Win32 exceptions" selects all options, interrupts when executed, and then in the call stack, finds the first line of code from the top down, There should be a problem statement.