Click here to get back home

win32::api doesn't work?

 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
win32::api doesn't work? Larry 01-18-2005
Posted by Larry on January 18, 2005, 11:47 pm
Please log in for more thread options
How come the chunk of code below doesn't work?

#!/perl

use strict;
use warnings;
use Win32::API;

my ($caps, $devices, $result);

Win32::API::Struct->typedef( 'WAVEINCAPS', qw(
INT ManufacturerID;
INT ProductID;
LONG DriverVersion;
TCHAR ProductName[32];
LONG Formats;
INT Channels;
INT Reserved;
)) or die "Typedef error $!n";

my $caps = Win32::API::Struct->new('WAVEINCAPS'); # Dim Caps As
WaveInCaps

Win32::API->Import( winmm => "int waveInGetNumDevs()");
Win32::API->Import( winmm => q{LRESULT waveInGetDevCaps(UINT_PTR
DeviceID, LPWAVEINCAPS pwic, UINT cbwic)} );

$devices = waveInGetNumDevs();

print "Devices: $devicesnn";

for (0 .. ($devices - 1) ) {
$result = waveInGetDevCaps($_, $caps,
Win32::API::Struct->sizeof('WAVEINCAPS'));
print "Device ID: $_ ,ProductName: $caps->n";
}

__END__;

It should return the product name of the devices (like soundblaster)
I can only get the number of the devices

Can anyone tell me what I am getting wrong?

Thanks ever so much!


Similar ThreadsPosted
win32::SerialPort are_match just won't work February 15, 2006, 8:05 pm
Does Win32::Perms $PermsObj->Remove( $User ) Work? June 22, 2005, 1:23 pm
NET:LDAP start_tls does not work July 7, 2004, 12:19 pm
Compress::Bzip2 needs work April 20, 2005, 9:41 pm
Apache::DBI + mod_perl 2.0.1. Please, help! Cannot get it work! November 2, 2005, 7:58 am
Custom PM Modules Won't Work May 2, 2006, 7:17 pm
mod_perl2 won't work w/ActivestateP588 V.822 August 7, 2007, 5:35 pm
H Start your own business doing affiliate work. H$OU,lh_ January 2, 2005, 12:41 am
Point me to MAC OS X Tiger GD instructions that work January 4, 2006, 8:50 pm
Net::FTP : Passive mode does not work as documented. June 20, 2006, 5:39 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap