This problem probably can be posted in different forums as well, because I see it happened every where when I start searching for the solution over the internet: VB, VC#, even some commercial applications, which probably used .NET to develop.
Any way, I developed my application using C/C++, so I figure this probably the best forum for me to post, and am hoping that you can help me to resolve the problem.
I have a C/C++ Windows program that has been running fine. Suddently, just over the weekend, I compile and running it from home (I took the laptop home), it bombs out and gives me the following error:
"0xC015000F: The activation context being deactivated is not the most recently activated one."
I was totally surprise, because I knew for sure that I did not change any source code after 5:00 pm Friday after I took the laptop home. The next Monday, I brought the laptop back to work, snap it into the dock-station, do a clean build, and the same error happen. I looked at the update to see if our Microsoft friend happen to update my laptop with some ...updates, but there was none.
I searched on the internet and learned that a lot of people have had the same problem that I am having now, but none gives me the solution.
Note that if I compile for 32 bit, the program runs fine...
Can anyone provide a light?
Hello;I have the same problem and I found this solution which works fine:CWinApp::InitInstance();
afxAmbientActCtx = FALSE; // <<-- Add this lineI hope this would help you.Good luck.(Original solution link : http://www.mombu.com/microsoft/mmc/t-activation-context-error-in-mmc-snap-ins-when-using-windows-vista-610122.html)Nacereddine
This error message often occurs when a function being called in a DLL terminates unexpectedly (usually via an uncaught exception). I just ran into a similar problem and managed to find the problem by getting VS2005 to throw _all_ Win32 exceptions during a debug session. To do that open the Exceptions dialog from Debug | Exceptions... and check the entire branch "Win32 Exception".
In my case a method in my DLL was trying to dereference a NULL pointer. The exception didn't cause a crash (later processing assigned a valid value to the pointer) but it DID break the activation context handling.
Use of afxAmbientActCtx = FALSE should only be used if you really know what you are doing - it may simply mask a real problem (one that's just as likely to come back and bite you months later :-)
Hope this turns out to be useful for somebody...
- Proposed as answer by Jason Steenstra-Pickens Thursday, March 10, 2011 2:46 AM
I'm using VS2008 and I got the same problem - I was using an invalid pointer and it caused a crash, but only later in a different DLL. I thought about blaming that other DLL's developer, good thing your post kept me from putting my foot in my mouth :)
I don't understand why by default not all Win32 exceptions are being trapped by the debugger though, this is likely causing many bugs to go on undetected.
Hey, That was a sweet tip!
I also thought I haden't changed my code...and all of a sudden a saw this message!
I been in the bussiness for so many years,but this was totaly new for me.
Thanks to your post I solved my issue in minutes...
And yes, I had changed my code, but memory is sometimes short!