Help on Win32 API

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I have a dll by name AduHid.dll.
There is a function with prototype

void * _stdcall  OpenAduDeviceBySerialNumber(const char*
psSerialNUmber,unsigned long iTimeout);

I used the following perl code to call the above function

use Win32::API;
my $function = Win32::API->new(
            'AduHid.dll','int   OpenAduDeviceBySerialNumber(const
char*  psSerialNUmber,unsigned long iTimeout)' );

my  $return = $function->Call("A03744",0);

But i get an error
1.  unknown parameter type const  and unsigned
2. Argument A03744 isnt numeric in subroutine entry.

I tried removing const and unsigned.Then I got an error
"Modification of read only value attempted".

Where am i going wrong?
Please advise.


Re: Help on Win32 API

On 06/20/2007 08:53 AM, jis wrote:
Quoted text here. Click to load it

I don't have access to a Windows computer, but I was able to download
the CPAN source for Win32::API. Read the POD for Win32::API::Types. It
says you should examine the __DATA__ section of Win32/API/ to
see a list of supported types.

You might need to specify a prototype like this:

int OpenAduDeviceBySerialNumber(PCHAR psSerialNUmber, ULONG iTimeout)

I hope this helps some.

Site Timeline