Anyone know how can I create a C# dll which can be called in Delphi 7 program? I do that through the ComVisibleAttribute but delphi program takes error.
C# DLL Code (Class Library Project):
namespace MyTest
{
[ComVisible(true)]
[GuidAttribute("EF00685F-1C14-4D05-9EFA-538B3137D86C")]
[ClassInterface(ClassInterfaceType.None)]
public class MainTest
{
public int AddP(int value)
{
return value + 314;
}
}
}
Delphi 7 Main Program Code:
function AddP(Value: integer): integer; stdcall;
external 'DelphiTest.dll';
procedure TfrmMain.btnConvertClick(Sender: TObject);
var value : double;
Begin
Text := IntToStr(AddP(10000));
End;
It takes error:
The application was unable to start correctly (0xc000007b). Click OK to close the application.