This reminds me of similar struggles that I had about a year ago. I posted a question about my situation (How to use Win32::API to access variable in DLL file?) and got very useful help from BrowserUk about how accomplish what I wanted using just the Win32 module. You might want to check it out to see if the information there might help you get started.
Of course, that was dealing with variables. For functions, you would use Win32::API. The combination of the post linked above and some sample code below might help get you going in the right direction.
use strict; use Win32::API; # Load the DLL my $dll = Win32::LoadLibrary('CrappyLibrary.dll') || die $^E; # Import the function my $func = new Win32::API('CrappyLibrary.dll','RegisterClient2','PP',' +I'); if (not defined $func) {die "Unable to import 'RegisterClient2' functi +on.\n";} my $client_id = 1; my $ip_addr = "192.168.1.1"; # Call the function my $value = $func->Call($client_id,$ip_addr); # unload DLL Win32::FreeLibrary($dll);
Hope this helps!
In reply to Re: Calling a function form an external DLL with Inline::C on windows
by dasgar
in thread Calling a function form an external DLL with Inline::C on windows
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |