engOpen hangs up when calling from dll

3 次查看(过去 30 天)
I am using COM services to interface with MATLAB from my project. For my startup project I am able to call engOpen and it returns an engine. However, I created a plugin for my application that compiles into a dll. Whenever I attempt to call engOpen from this library, the process hangs up and just sits there at the same memory usage and goes to 0 cpu usage.

采纳的回答

Thomas Stubbs
Thomas Stubbs 2019-8-26
The problem was calling engOpen while loading the library or creating a COM thread in the DllMain. This goes against the best practices suggested here - https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices. I called engOpen from a method that wasn't statically initialized using GetProcAddress and it worked fine.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by