in reply to Perl calling my.DLL for serial port work.

You want to use Win32::API for accessing the code in the DLL. Most likely, the signatures will be:

  1. my $SSC_OPEN = Win32::API->new( 'ssc-5', 'SSC_OPEN', 'II', 'I', ); sub SSC_OPEN { $SSC_OPEN->Call(@_); };
  2. my $SSC_MOVE = Win32::API->new( 'ssc-5', 'SSC_MOVE', 'II', 'I', ); sub SSC_MOVE { $SSC_MOVE->Call(@_); };
  3. my $SSC_CLOSE = Win32::API->new( 'ssc-5', 'SSC_CLOSE', '', '', ); sub SSC_CLOSE { $SSC_CLOSE->Call(@_); };

Replies are listed 'Best First'.
Re^2: Perl calling my.DLL for serial port work.
by kansaschuck (Sexton) on Feb 03, 2008 at 16:35 UTC
    Thanks Corion, that's a great start. I'm working thru some problems at the moment. 'cant find new... maybe you forgot to load winapi.' Doing some research on the winapi load. kc

      Most of the time, it really helps if you copy and paste the exact error message you're getting, together with the code (a really small, self-contained example) that causes this.

      My guess is that you're just missing the following line at the top of your program:

      use Win32::API;

      Also see the use keyword.

        Thanks for the posting advice and help, (window XP enviroment) Here's the error message below:
        C:\Perl\perlscripts>monks01.pl Can't locate Win32/API.pm in @INC (@INC contains: C:/Perl/site/lib C:/ +Perl/lib .) at C:\Perl\perlscripts\monks01.pl line 5. BEGIN failed--compilation aborted at C:\Perl\perlscripts\monks01.pl li +ne 5.
        code to follow:
        #! perl -w # use Win32; use Win32::API; my $SSC_OPEN = Win32::API->new( 'ssc-5', 'SSC_OPEN', '1', '2400', ); s +ub SSC_OPEN { $SSC_OPEN->Call(@_); }; # my $SSC_MOVE = Win32::API->new( 'ssc-5', 'SSC_MOVE', '1', '1', ); sub +SSC_MOVE { $SSC_MOVE->Call(@_); }; # my $SSC_CLOSE = Win32::API->new( 'ssc-5', 'SSC_CLOSE', '', '', ); sub +SSC_CLOSE { $SSC_CLOSE->Call(@_); };