.netrestdelphicomloaderlock

Delphi - OS Loader Lock issue suddenly appearing with Excel


I am working on a Delphi plugin for Excel. It also uses the AddIn Express COM Library (excellent BTW). The code had been working fine. I have added another Ribbon menu option, which calls a new form. This form has the REST controls (Client, Response, etc.). While the components are tied to each other, they do not have information about URLs. This is set at runtime. I compile my project.

This used to run fine, but I have just added a form (specifically, I added a parent form, with REST components, a RestAdapter, TDatasource and ClientDataSet, and inherited from it). In Googling, it appears that this is a debugger issue, and that (at least in Visual Studio), this can be turned off via Exceptions / Ignore Loader Lock. I cannot find any similar functionality within the Delphi (Seattle) debugger.

I have run AddIn express without issues, my plugin used to run without issue, and I have run standalone REST demo apps without issues. Is it possible that the combination is causing this problem? Any idea how to disable the debugger checking for Loader Lock? If it helps any, the last message PRIOR to the “OS Loader Lock” message in the event log shows that module: CSCAPI.dll was loaded. I am wondering if I need to dynamically create the REST components. My suspicion is that these components are created when the app (aka Excel with my plugin) starts, and something is being initialized in a way that is making the debugger upset...


Solution

  • I finally solved what was happening. I had purchased and installed another Excel plugin. It was that which was causing my issue. Apparently it uses code within it's initialization routine which was causing my issue. Once I set that plugin to inactive, my code works fine. It wasn't an issue with the REST components at all.