我试图将 delphi dll 导入我的 vb.net 项目
这是我的代码:
Private Declare Function AddIntegers Lib "C:\Program Files (x86)\Borland\Delphi6\Projects\first dll\Project2.dll" Alias "AddIntegers" (ByVal a As Integer, ByVal b As Integer) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ii As Integer = AddIntegers(1, 3)
MsgBox(ii)
End Sub
这是delphi库代码:
library MyFirstLibrary;
uses
SysUtils,
Classes;
{$R *.res}
function AddIntegers(_a, _b: integer): integer; stdcall;
begin
Result := _a + _b;
end;
exports
AddIntegers;
begin
end.
有一个 EntryPointNotFoundException:
Unable to find an entry point named 'AddIntegers' in DLL 'C:\Program Files (x86)\Borland\Delphi6\Projects\first dll\Project2.dll'.":""
如何修复 EntryPointNotFoundException(我的 delphi 代码中存在 AddIntegers 函数)?(vb.net 或 c#)