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: Beginner:
Load DLL

 



tellojsu
New User

Apr 23, 2008, 8:37 AM

Post #1 of 4 (4655 views)
Load DLL Can't Post

I am new to Perl and i am trying to load a dll but cannot find anything on how to do this.

Currently i have some dll that was compiled in C called myFile.dll

I want to be able to use this dll in my perl code and call its functions. How can i do this?

Thanks


KevinR
Veteran


Apr 23, 2008, 11:11 AM

Post #2 of 4 (4647 views)
Re: [tellojsu] Load DLL [In reply to] Can't Post

Windows? Look into the Win32 class of modules. I don't know off the top of my head.
-------------------------------------------------


tellojsu
New User

Apr 25, 2008, 6:39 AM

Post #3 of 4 (4642 views)
Re: [KevinR] Load DLL [In reply to] Can't Post

I managed to install the Win32 and Win32API. I am running Perl 5.10.

The problem i am know running into is getting it to see the dll file.

I know win32 is functioning correctly as i am able to display the PID by loading the sytem32 dll and calling the function getCurrentPID.


Code
Win32::API->Import("kernel32", "int GetCurrentProcessId()"); 

$PID = GetCurrentProcessId();
print "Current PID is => " . $PID . "\n";


but when i try


Code
$GetFreeBoards = Win32::API->Import("myDLL.dll", 'int GetFreeBoards(long nBrdsToGet, long* nBrds, char* ListNames)',);


It does not work and i print out $^E to see what errors i am getting as the import returns 0 which is fail.

$^E returns always "The specified procedure could not be found"

I have tried using "new" instead of "import" and i get the same problem. which brings me to the conclusion it is not reading the dLL file. i have regsvr32 "myDLL.dll" and have it placed in the same directory as the perl file and i still get this same problem.

Any ideas or suggestions?


KevinR
Veteran


Apr 25, 2008, 11:34 AM

Post #4 of 4 (4636 views)
Re: [tellojsu] Load DLL [In reply to] Can't Post

I'm sorry but I have zero experience in this area.
-------------------------------------------------

 
 


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

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