I'm developing a 64-bit in-proc VC++ ATL COM server that basically just redirects all calls to an out-proc COM server. So my COM server basically does nothing.
Initially it used the C++ runtime in a DLL (/MD
compiler switch). I've noticed that when I deploy it on a clean 64-bit Win2k3 regsvr32 fails with an error: LoadLibrary({fileName}) failed – This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Google helps - the problem is that VC++9 runtime is not installed. The problem persists even when msvcr90.dll is in the same directory as my COM server. That as I guess is because of how search for dependent libraries works - it doen't look into the same directory and I need the msvcr90.dll in Windows\System32 or the like. Since this is a complication to my deployment I switched to using the statically linked C++ runtime (/MT compiler switch). Now it deploys fine. The size of the .dll file is 110k only (was 45k) so it doesn't bother me.
Now I've heard a lot about how bad it is to mix different versions of C++ runtime in one process - CRT state can be broken, hell can break loose and so on. Do I have to think of this and expect problems from changing /MD to /MT especially since I don't know what version the COM server consumers are using?