visual-studio-2010visual-c++mfcredistributable

MFC program has runtime error R6025 on certain Windows 7 32 bit computers only and fixes after installing Visual Studio on it


I have a MFC application compiled with Visual Studio 2010. On a certain computer (32 bit), it had "Runtime error: R6025 pure virtual function call" error message and sometimes a silent close (with no crash).

After convincing the customer to install Visual Studio 2010, the error disappeared automatically. But I don't know why. The Visual C++ 2010 redistributables (x86) were installed before installing Visual Studio on that PC.

Why installing Visual Studio 2010 on it fixed it even though the redistributables were installed? Maybe the redistributables were corrupted? (If this is possible) Or Visual Studio install other files that can affect?

I need to explain the customer what fixed the error, but I'm not sure. Is there any safe way to force the application to use the MFC files that I want to avoid these kind of difficult-to-reproduce bugs?

By the way, there was no call to pure virtual function, so I think that there might be some relation to the distributables or some other files.


Solution

  • In my experience, that "call to pure virtual" error sometimes happens when you've built against the wrong version of the Windows SDK by setting the WINVER defines to a higher level of OS than the one you run on.

    That doesn't explain why the problem was fixed though so also make sure the redistributables you installed were for the same Service Pack of VS2010 as you used for the build.