David Legault wrote:

> Hello,
> 
> I'm trying to use the Win32:API module to access a DLL function with 
> this perl code :
> 
> $function = Win32::API->new( 'test.dll', 'int startSimulation(int 
> eRunMode)', );

Try an alternate calling method and see if it makes a diff :

        my $function = Win32::API->new('test.dll', 'i', 'i') or die "import: $! 
($^E);
        my $return = $function->Call(0);

or

        my $startSimulation = Win32::API->Import('test.dll',
          'int startSimulation (int eRunMode)') or
          die "import startSimulation: $! ($^E)";
        my $return = startSimulation (0);

        print "$return\n";


> $return = $function->Call(0);
> print $return;
> 
> The C code for the function in the DLL is :
> 
> int startSimulation( int eRunMode ) {
> 
>    return 0;
> }
> 
> Which is very basic and the Symbol is exported with a .def file.
> 
> When I run the perl code, it crashes with a pointer to NULL memory access.
> 
> If anyone has a clue on why this is happening, or has a fix for it, I'd 
> be glad to know.
> 
> P.S. I also tried WJ patched version available at 
> http://www.xs4all.nl/~itsme/projects/perl/ with the same result.


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to