I am having trouble calling a third party dll to control an rfid reader. this is my code:
use Win32::API;
Win32::API::More->Import("kernel32", "int GetCurrentProcessId()");
Win32::API::More->Import("UHFReader288.dll", "OpenComPort","IPPI","I","_cdecl");
sub OpenReader {
my $comport = 1;
my $comAddr = " " x 255;
my $baud = "5";
my $handle = -1;
my $result = OpenComPort($comport,$comAddr,$baud ,$handle);
return $result;
}
The following is the function's prototype:
int OpenComPort(int port, BYTE* ComAdr, BYTE baud, int* FrmHandle);
The function's documentation is provided by the following image (sorry):
Can someone please show me what I am doing wrong? When I call the function, the Perl interpreter crashes!!
I am running strawberry Perl 5.24 on Win10