Drone 605
Drone 605

Reputation:

Delphi 5 calling C++ dll causing Access Violation

Here is the Delphi code calling the C++/CLI DLL:

implementation

{$R *.DFM}

procedure CallMe(x: Integer); stdcall; external 'CppWrapper.dll';

procedure TForm1.Button1Click(Sender: TObject); 
begin
  CallMe(1); 
end;

end.

After clicking the form button I get an exception.

Upvotes: 1

Views: 824

Answers (1)

Pavel Minaev
Pavel Minaev

Reputation: 101555

Make sure that your C++ function is declared as __stdcall.

Upvotes: 5

Related Questions