CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Perl error when calling native dll

 



exvance
New User

Aug 30, 2010, 1:16 PM

Post #1 of 1 (5740 views)
Perl error when calling native dll Can't Post

I'm new to perl. I'm sure I'm just doing something silly. I hope someone will be kind enough to point out what I'm doing wrong.

Here's my perl code:

Code
#!/usr/bin/perl -w 
use strict;
use Win32::API;

sub Init
{
my $reprise = Win32::API->new('rlm', 'rlm_init', 'P', 'N');
my $handle = $reprise->Call('.');
}

Init();

1;


Here is the method I'm trying to call:

Code
extern struct rlm_handle *	rlm_init(const char *, const char *,  
const char *);


I've tried passing one parameter, two, all three...same output.
When it runs the "Call" line I get an event log entry like this:

Code
Faulting application name: perl.exe, version: 5.10.0.1004, time stamp: 0x48bef0d8 
Faulting module name: perl510.dll, version: 5.10.0.1004, time stamp: 0x48bef0d7
Exception code: 0xc0000005
Fault offset: 0x00047daa
Faulting process id: 0xe80
Faulting application start time: 0x01cb487c07ea0010


If I try to debug using Visual Studio it gives me this:


Code
Unhandled exception at 0x28047daa in perl.exe: 0xC0000005: Access violation writing location 0x00000004.


The publisher of the dll I'm calling has never used it from perl and is unable to provide assistance. What am I doing wrong?

Thanks,

Eric

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives