I'm trying to import a method from a .NET DLL to my DelphiScript:
function GetAnswer() : string; external 'PixelPatternCaptcha.dll';
begin
Print(GetAnswer)
end.
The statement Print(GetAnswer)
seems to trigger an error:
Module: "", Line: 3, Message: Access violation at address 00000000. Read of address 00000000
I'm not sure how to specify the path for the method. I have the DLL in the same folder as the script that imports it.
It looks like the DLL actually gets invoked. When I try to delete the DLL, the operating system tells me that my .exe
file has it opened.
Currently working on it:
procedure GetAnswer(out codeResult: WideString); stdcall; external 'PixelPatternCaptcha.dll';
var r : WideString;
begin
print(GetAnswer(r));
end.