Invoking Win32 dll from Perl.

S

Sharad K

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
 
S

Sharad K

Cat said:
Sharad said:
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
 
C

Cat

Sharad said:
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
 
C

Cat

Sharad said:
Cat said:
Sharad said:
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
 
S

Sharad K

Cat said:
Sharad said:
Cat said:
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 :).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top