Rick
2010-09-01 12:31:52
I'm trying to make a plugin for Simba, however I receive the following error when testing the plugin:
I have installed Lazarus + fpc 2.4.3.
The above compiles in Lazarus, however when run the debugger "enters error state". I can compile and run the source of IrokiPlugin with no errors.
Any help with this would be appreciated :)
Exception in Script: Error loading plugin C:\Simba\Plugins\TestPlug.dll
I have installed Lazarus + fpc 2.4.3.
library TestPlug;
{$mode objfpc}{$H+}
uses
Classes, sysutils;
{$R *.res}
function Test_Func(var T: String): Integer; register;
begin
T := 'abc';
Result := 123;
end;
function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;
function GetFunctionCallingConv(x : integer) : integer; stdcall;
begin
result := 0;
case x of
0 : result := 1;
end;
end;
function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @Test_Func;
StrPCopy(ProcDef, 'function Test_Func(var T: String): Integer;');
end;
else
x := -1;
end;
Result := x;
end;
exports GetFunctionCount;
exports GetFunctionInfo;
exports GetFunctionCallingConv;
begin
end.
The above compiles in Lazarus, however when run the debugger "enters error state". I can compile and run the source of IrokiPlugin with no errors.
Any help with this would be appreciated :)