I am using Win21::API to call a function in a custom-built DLL
(mydll.dll) to perform an image analysis.

The C function call is defined as
int analyzeImage(
        char* outputcsv;
        unsigned short* image;
        unsigned int cols;
        unsigned int rows;

)

My perl codes below seem to work since an expected output is generated.
However, it always ends up with a fatal pop-up error window:
"Perl Command Line Interpreter has encountered a problem and needs to
close. We are sorry for the inconvenience."

Does anyone has any clue what could be wrong causing this pop-up error
window? The last line of the codes is never being executed.

Thanks for helps.

Eugene


##### code snippet #####
use Win32::API;
use strict;
use warnings;

my $imageFile="C:\\temp\\demo.img";
my $csv="C:\\temp\\demo.csv";
my $col=1024; #the image is 1024x1024
my $row=1024; 

my $header;
my $headerSize=2*1024; # the image has a header of 2k bytes my $image;
my $imageSize=1024*1024*2; # each pixel is an unsigned short type  

open(FH, "+<$imageFile") or die "\nCan not open $imageFile: $!\n";
binmode(FH); read(FH, $header, $headerSize) == $headerSize or print
"\nshort read: $!\n"; read(FH, $image, $imageSize) == $imageSize or
print "\nshort read: $!\n"; close(FH);

my $analyzeImage = Win32::API->new("mydll", "analyzeImage", "PPII",
"I"); my $status = $analyzeImage->Call($csv,$image,$col,$row);

print "\nStatus: $status";






_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to