1, problem description
Original development environment: WIN7 64-bit flagship edition, Vs2010,thinkpad T460
Problem: Your own MFC program developed in the WinXP environment does not work properly, the box "cannot locate the program input point initializeconditionvariable in the dynamic link library Kernel32.dll"
Re-build the development environment: WinXP SP3 Pro, vs2010,gigabyte a motherboard (forgive office no other free host)
The problem persists: recompile passes, but the runtime is still a box "unable to locate the program input point initializeconditionvariable in the dynamic link library Kernel32.dll", my breakpoint under the program entry is not executed.
2. Reason
(1) If the program is not developed by itself: it is generally incompatible, but it may be another reason.
(2) If the program you want to develop is compatible with the WinXP system: Don't underestimate Microsoft, let alone a few. Generally there is no other reason for the mess, just because the WinXP system Kernel32.dll is not initializeconditionvariable. Prior to development on the Win7, you or MFC program called the Kernel32.dll in the initializeconditionvariable, so on XP can not run at all. is usually caused by the improper multithreading process .
3. Solution
(1) If you do not develop the program: Want to try to solve, please refer to Baidu out of the way, but must be prepared in advance WinPE system (USB disk boot disk), and the original Kernel32.dll file backup! Because replacing the Kernel32.dll file is very likely to cause your operating system to turn off.
(2) If the program you want to develop is compatible with the WinXP system:
- It is best to build the development environment on WinXP and then debug the code.
- Best direct Google, the quality of Chinese materials generally. Don't ask me how I know O (≧ port ≦) o
- Although there are only two answers, they are the essence. Reference Link: http://stackoverflow.com/questions/2847960/ Procedure-entry-point-initializeconditionvariable-could-not-be-located-in-kernel
- The code in the high-ticket answer may not solve the problem, and in the second answer, the Lord has posted his own blog https://www.justsoftwaresolutions.co.uk/threading/ Implementing-a-thread-safe-queue-using-condition-variables.html hope to be inspired by you, anyway, it inspired me (∩_∩)
- For my program, I was positioned to the point where the problem was the pallet , and the pallet involved something relatively lower. Now that I've commented on the tray function, I can run it again on the WinXP, and then see if it can be compatible with the pallet to make it work on XP.
VS2010+WINXP+MFC program cannot locate program input point in dynamic link library