I want to call HCE300_API.DLL with Win32::API. I use this script which crashes the Perl interpreter when calling $readdevice:
#!/usr/bin/perl use strict; use warnings; use Win32::API; my $com = 1; my $opencom =Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_Open(int ComPort)', )or die $^E;; my $closecom = Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_Close()', )or die $^E;; my $getdevicetype = Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_GetDeviceType()'); my $resetdevice = Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_Reset(int ResetWay)' +); my $readdevice = Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_Read(int TrackNo(int + TrackNo,char *ReadData )'); my $setdialog = Win32::API->new ( 'HCE300_API.DLL', 'int HCE300_SetShowDialog(int In +Flag)'); #print $getdevicetype->Call(),"\n"; my @in; my $ret = $opencom->Call ($com); print "$ret\n"; $resetdevice->Call (1); my $dialog = $setdialog->Call(1); my @strip = $readdevice->Call(2,\@in); my $cl = $closecom->Call(); print "$cl\n";
I have no usable documentation only a sample for C-code from which I took the function for the prototype. Since I have zero knowledge of C any help is appreciated.

In reply to Correct call for dll with Win32::API by walto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.