Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Invoking Win32 dll from Perl.

Reply
Thread Tools

Invoking Win32 dll from Perl.

 
 
Sharad K
Guest
Posts: n/a
 
      07-09-2003
Hi all,

I am trying to invoke a function in kernel32.dll from my perl program which
looks like this -

use Win32::API;
$GetPID = new Win32::API("kernel32", "GetCurrentProcessId", '', 'N');
$PID = $GetPID->Call();

But ActivePerl cribs saying "Can't locate Win32/API.pm in @INC (@INC
contains: E:/Perl/lib E:/Perl/site/lib .
) at 1.pl line 2."

Can anyone please point me the source of the error.

Thanks in advance,
Sharad


 
Reply With Quote
 
 
 
 
Sharad K
Guest
Posts: n/a
 
      07-09-2003

"Cat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sharad K wrote:
> >
> > Hi all,
> >
> > I am trying to invoke a function in kernel32.dll from my perl program

which
> > looks like this -
> >
> > use Win32::API;
> > $GetPID = new Win32::API("kernel32", "GetCurrentProcessId", '', 'N');
> > $PID = $GetPID->Call();
> >
> > But ActivePerl cribs saying "Can't locate Win32/API.pm in @INC (@INC
> > contains: E:/Perl/lib E:/Perl/site/lib .
> > ) at 1.pl line 2."
> >
> > Can anyone please point me the source of the error.
> >

>
> The message is telling you that perl can't find the Win32::API module.
>
> Use ppm or ppm3 to 'install' it.
>
> C:\ppm3
> <blah blah blah>
>
> ppm> search Win32::API
> Searching in Active Repositories
> 1. Win32-API [0.41] Perl Win32 API Import Facility
> 2. Win32-API-OutputDebugString [0.03] OutputDebugString Win32 API

support
> ppm> install 1


Thanks for the reply.
I downloaded the Win32::API perl extension from http://dada.perl.it/#api.
After installing Win32::API and putting it in the right folders I got this
error messsage -
"Can't locate loadable object for module Win32::API in @INC".

Can you tell me what is the cause of the problem now?

Thanks again,
Sharad




 
Reply With Quote
 
 
 
 
Cat
Guest
Posts: n/a
 
      07-09-2003
Sharad K wrote:
>
> Hi all,
>
> I am trying to invoke a function in kernel32.dll from my perl program which
> looks like this -
>
> use Win32::API;
> $GetPID = new Win32::API("kernel32", "GetCurrentProcessId", '', 'N');
> $PID = $GetPID->Call();
>
> But ActivePerl cribs saying "Can't locate Win32/API.pm in @INC (@INC
> contains: E:/Perl/lib E:/Perl/site/lib .
> ) at 1.pl line 2."
>
> Can anyone please point me the source of the error.
>


The message is telling you that perl can't find the Win32::API module.

Use ppm or ppm3 to 'install' it.

C:\ppm3
<blah blah blah>

ppm> search Win32::API
Searching in Active Repositories
1. Win32-API [0.41] Perl Win32 API Import Facility
2. Win32-API-OutputDebugString [0.03] OutputDebugString Win32 API support
ppm> install 1
 
Reply With Quote
 
Cat
Guest
Posts: n/a
 
      07-09-2003
Sharad K wrote:
>
> "Cat" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Sharad K wrote:
> > >
> > > Hi all,
> > >
> > > I am trying to invoke a function in kernel32.dll from my perl program

> which
> > > looks like this -
> > >
> > > use Win32::API;
> > > $GetPID = new Win32::API("kernel32", "GetCurrentProcessId", '', 'N');
> > > $PID = $GetPID->Call();
> > >
> > > But ActivePerl cribs saying "Can't locate Win32/API.pm in @INC (@INC
> > > contains: E:/Perl/lib E:/Perl/site/lib .
> > > ) at 1.pl line 2."
> > >
> > > Can anyone please point me the source of the error.
> > >

> >
> > The message is telling you that perl can't find the Win32::API module.
> >
> > Use ppm or ppm3 to 'install' it.
> >
> > C:\ppm3
> > <blah blah blah>
> >
> > ppm> search Win32::API
> > Searching in Active Repositories
> > 1. Win32-API [0.41] Perl Win32 API Import Facility
> > 2. Win32-API-OutputDebugString [0.03] OutputDebugString Win32 API

> support
> > ppm> install 1

>
> Thanks for the reply.
> I downloaded the Win32::API perl extension from http://dada.perl.it/#api.
> After installing Win32::API and putting it in the right folders I got this
> error messsage -
> "Can't locate loadable object for module Win32::API in @INC".
>
> Can you tell me what is the cause of the problem now?
>
> Thanks again,
> Sharad


Check that you have the modules
Win32::API::Type and
Win32::API::Struct

It looks to me that you haven't got all the ::API's installed
 
Reply With Quote
 
Sharad K
Guest
Posts: n/a
 
      07-09-2003

"Cat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sharad K wrote:
> >
> > "Cat" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Sharad K wrote:
> > > >
> > > > Hi all,
> > > >
> > > > I am trying to invoke a function in kernel32.dll from my perl

program
> > which
> > > > looks like this -
> > > >
> > > > use Win32::API;
> > > > $GetPID = new Win32::API("kernel32", "GetCurrentProcessId", '',

'N');
> > > > $PID = $GetPID->Call();
> > > >
> > > > But ActivePerl cribs saying "Can't locate Win32/API.pm in @INC (@INC
> > > > contains: E:/Perl/lib E:/Perl/site/lib .
> > > > ) at 1.pl line 2."
> > > >
> > > > Can anyone please point me the source of the error.
> > > >
> > >
> > > The message is telling you that perl can't find the Win32::API module.
> > >
> > > Use ppm or ppm3 to 'install' it.
> > >
> > > C:\ppm3
> > > <blah blah blah>
> > >
> > > ppm> search Win32::API
> > > Searching in Active Repositories
> > > 1. Win32-API [0.41] Perl Win32 API Import Facility
> > > 2. Win32-API-OutputDebugString [0.03] OutputDebugString Win32 API

> > support
> > > ppm> install 1

> >
> > Thanks for the reply.
> > I downloaded the Win32::API perl extension from

http://dada.perl.it/#api.
> > After installing Win32::API and putting it in the right folders I got

this
> > error messsage -
> > "Can't locate loadable object for module Win32::API in @INC".
> >
> > Can you tell me what is the cause of the problem now?
> >
> > Thanks again,
> > Sharad

>
> Check that you have the modules
> Win32::API::Type and
> Win32::API::Struct
>
> It looks to me that you haven't got all the ::API's installed


Thanks a lot. I got the problem fixed.
I owe you a coffee now .


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DLL Communication Interface: Win32 DLL <-> .NET class library Ezmeralda C++ 1 04-03-2007 03:45 PM
Second long argument to a JNI call on a Win32 DLL contains zero when it reaches the DLL pcarr01 Java 3 02-17-2005 09:30 AM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments