La struttura che segue è tipica di VB:
In Perl la posso rendere tramite Win32::API::Structcodice:Private Type WaveInCaps ManufacturerID As Integer ProductID As Integer DriverVersion As Long ProductName(1 To 32) As Byte Formats As Long Channels As Integer Reserved As Integer End Type
In VB chiamo o lego una struttura ad una variabile cosi':codice:Win32::API::Struct->typedef(WAVEINCAPS => qw( INT ManufacturerID; INT ProductID; LONG DriverVersion; TCHAR ProductName[32]; LONG Formats; INT Channels; INT Reserved; ) );
In Perl lo farò cosi':codice:Dim Caps As WaveInCaps
La chiamata e il passaggio di valori alla funzione nella DLL in VB avviene cosi':codice:my $caps = Win32::API::Struct->new('WAVEINCAPS');
Cosi' in Perl:codice:Call waveInGetDevCaps(0, VarPtr(Caps), Len(Caps))
informazioni per il modulo Win32::API::Structcodice:my $result = waveInGetDevCaps( 0, $caps, Win32::API::Struct->sizeof('WAVEINCAPS') );



Rispondi quotando