brettc has asked for the wisdom of the Perl Monks concerning the following question:

I have been give the task of writting a perl script that interfaces with a dll. I looked high and low and found Win32::API. Which seems to slove my problems. I would happily take any other suggestions on how to interface a dll. I downloaded, nmake'd etc. the API module. I then moved the dll to the WINNT/system32 and to the perl/lib/auto/Win32/api directory. I then tried to run my simple script use Win32::API;   #pretty simple. I got an error stating that could not find the PerlCRT.dll. I then down loaded and placed the PerlCRT.dll in the WINNT/system32 directory and put the PerlCRT.lib in the perl/lib/auto/win32 directory. I ran the above script again. I didn't get an error on the command line I did how ever get a memory error in the lovely window pop-up box.

The instruction at "0x10002309" referenced memory at"0x08aed2a4". The memory could not be "read". Click on ok to terminate applicaion. Blah blah blah

Does anyone know how to fix this problem? OR a fail safe way of installing PerlCRT and Win32::API? Or a better way of interfacing a DLL.

Thanks in advance for the help.

Brett

Edit by tye

Replies are listed 'Best First'.
(tye)Re: Problem with PerlCRT.dll + Win32::API
by tye (Sage) on May 17, 2001 at 03:55 UTC

    You have installed a pre-built version of Win32::API that was meant to be used with an incompatible pre-built version of Perl. Remove the PerlCRT.dll and find a pre-built version of Win32::API that is meant for your version of Perl. (I'd tell you to uninstall that Win32::API but I'm not aware of a trivial, fool-proof way to do that.)

            - tye (but my friends call me "Tye")
      Thanks Tye, It appears that A new install of the Win32::API directly from Activestate.com seems to not throw errors, when I run the script use Win32::API so that get me over the hump. Thanks for the help, it is appreciated. Brett