“DLL caused an exception” when calling a method th

2019-08-08 03:28发布

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.

0条回答
登录 后发表回答