Search code examples
delphidelphi-10.2-tokyo

"Server execution failed" and "Duplicates not allowed" messages after upgrade to Delphi 10.2.3


I've just had to update my RAD Studio 10.2.0 Tokyo installation to 10.2.3, so that I could set the TRESTClient.SecureProtocols property to [THTTPSecureProtocol.TLS12] to enforce TLS 1.2 usage for a third-party web API, but I've run into problems with my other 10.2 applications.

Running a different program in the IDE, which built fine, there is a startup process where it needs to instantiate an object from a COM library dll using CreateComObject. This throws a "Server execution failed" error.

Rebuilding that COM library in the new 10.2.3 and registering it again using Regsvr32 resolved the problem, but then the next part of the startup process loads a library using LoadLibrary, and that threw a "Duplicates not allowed" error.

Again, rebuilding that non-COM library in 10.2.3 resolves the problem, but then I run into the same "Server execution failed" error when I try to instantiate an object on a COM server exe rather than library. Rebuilding that EXE resolved the problem.

I was also seeing a "Runtime error 217" when using Winapi.Windows.CreateProcess to start an EXE built using 10.2.0. Rebuilding that EXE in 10.2.3 fixes the error.

There doesn't seem to be any difference in the System.Win.ComObj.pas or Winapi.Windows.pas between 10.2.0 and 10.2.3, so what the heck is going on? Why am I needing to rebuild all these other projects?

More importantly, what's going to happen if I need to use a COM library/server or a dynamic link library that's not mine? What about other third-party developers who use our libraries in their own programs? Is it all going to suddenly stop working?

EDIT:

It must be to do with the RAD Studio installation, as I now get "Runtime error 217" messages for every 10.2.0 program I have, that prior to the upgrade all worked fine, and some of these programs use the OutputDebugString to immediately write to the debugger, and I'm not seeing anything at all in DebugView.

EDIT:

After reinstalling 10.2.0 all the "Runtime error 217" messages disappeared.


Solution

  • Turns out it was a stuffed up install of 10.2.3. After restarting my machine and reinstalling 10.2.3, the 217 errors went away, even without rebuilding any of the other programs.

    What I really disliked though was that, using either the ISO or the web installer, I am forced to uninstall the 10.2.0 build and therefore lose all of the package information. Takes me 3 hours to rebuild and reinstall all the packages required for our product suites.

    I guess that's just par-for-the-course, as there could have been breaking changes in Update 3 that stopped these packages from working.