“DLL caused an exception” when calling a method that references another DLL

我与影子孤独终老i 提交于 2019-12-24 14:07:50

问题


I developed a DLL, let's call it DomainLogic.dll, with some public methods through [DllExport] annotation. Some of those methods make calls to another DLL, let's call it Utils.dll. I developed a demo WinForm application with some buttons that call methods of DomainLogic.dll and everything works as expected.

Currently we have a partner which wants to call our DomainLogic.dll from their existing Visual FoxPro application.

They were able to successfully call dll methods that receive and return strings and open forms. However when they try to call a method that internally makes a call to another DLL (Utils.dll), a FoxPro error is displayed saying "Declare DLL call caused an exception".

SET DEFAULT TO C:\Folder\Containing\DLLs
DECLARE ExampleMethod IN DomainLogic.dll
? ExampleMethod()

Any idea how to solve/debug this?

More info:

  • Our DLLs require .NET 4.0, they have 4.5.2 installed.
  • Utils.dll is correct, I successfully called the same methods using my demo app.
  • We already executed the regasm /codebase command for both DLLs.
  • We are running the FoxPro app on the same folder as the DLLs using FoxPro's SET PATH command.

来源:https://stackoverflow.com/questions/34020022/dll-caused-an-exception-when-calling-a-method-that-references-another-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!