Click here to get back home

Help on Win32 API

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Help on Win32 API jis 06-20-2007
Posted by jis on June 20, 2007, 9:53 am
Please log in for more thread options


Hi,

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.

regards,
jis


Posted by Mumia W. on June 20, 2007, 11:44 am
Please log in for more thread options


On 06/20/2007 08:53 AM, jis wrote:
> Hi,
>
> 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.
>
> regards,
> jis
>

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/Types.pm 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.

Similar ThreadsPosted
Dave Roth's site (Win32::AdminMisc, Win32::ODBC, etc.) not available. December 22, 2005, 8:46 am
Problems installing Win32-Setupsup, Win32-CtrlGUI October 10, 2004, 12:31 am
Win32-PerfMon on Win32 October 26, 2004, 1:12 pm
Win32::API, please help August 10, 2004, 10:02 am
Win32::API September 22, 2005, 2:00 pm
WIN32::API on .net April 4, 2005, 5:44 am
WIN32::API on .net April 4, 2005, 7:06 am
win32 April 26, 2006, 9:12 am
Win32::OLE.pm and Hyperlinks July 22, 2004, 1:09 pm
Need help with Win32::SerialPort August 13, 2004, 5:43 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap