Excel - Using AddIn Express with REST components...

Add-in Express™ Support Service
That's what is more important than anything else

Excel - Using AddIn Express with REST components...
OS Loader Lock issue 
George Spears




Posts: 70
Joined: 2010-05-06
I am working with a Delphi plugin for Excel. 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. If I run it standalone (outside of debugger), it runs fine. It sets the URL resources, calls the REST service, and displays data in a memo. If I run it from within Delphi, I get dumped into assembly code, and I get the error message in the Event Log “Attempting managed execution inside OS Loader Lock. Do not attempt to run managed code inside a DllMain or image initiations function since doing so can cause the application to hang.” To my knowledge, I have not done this… This used to run fine, but I have added a form (specifically, I added a parent form, with REST components, 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, 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.
Posted 05 Sep, 2016 09:27:01 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello George,

We've created an add-in using Add-in Express for Office and VCL, added a form with several REST components and tried to debug it. This works correctly for us.

What debugger is set in Registered Debuggers, see Tools | Options | Debugger Options?

Check if the uses sections in your modules have some units that use managed code.

We recommend to check the call stack (set the Use Debug .DCUs check box in Delphi Compiler | Compiling, see the project's options) and find the program calling the managed code.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Sep, 2016 08:27:31 Top
George Spears




Posts: 70
Joined: 2010-05-06
I finally solved what was happening. I had purchased and installed another Excel plugin (Kutools for Excel). 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.

Thanks for your help.
Posted 07 Sep, 2016 06:47:58 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Thank you for letting us know about what caused the issue!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 07 Sep, 2016 06:57:05 Top