Adam R. Frielink wrote:
>  
>>
>>my $mode = pack 'C148', 0 x 180;      # I padded 32 just in case

I meant that 148 to also be 180 for safety (in case the actual
structure was longer - usually you would supply a size arg in a
structure that is returned as the only in/out arg, but apparently
not here):
        my $mode = pack 'C180', 0 x 180;

>>my $ret = $PEGetSelectedPrinter->Call($printJob, 
>>$driverHandle, $driverLength,
>>   $printerHandle, $printerLength, $portHandle, $portLength, $mode);
>>if ($ret < 1) {       
>>      # I assume a true/positive condition would be good
>>      die "PEGetSelectedPrinter: $! ($^E)";
>>}
>>
>>You'll need to unpack whatever values are returned that you need.
>
> So, my DEVMODE is a defines as 
> 
>  DEVMODE * FAR *mode
> 
> How does one unpack a double pointer to a struct?

I would assume define it as a ptr:
        my $mode = pack 'P', 0;

And then you would need to do something like:

        my @devmode = unpack 'C180', unpack ('P', $mode);

on that pointer if I'm thinking right or replace the C180 with a list
of each field in the structure's actual type:

        my ($dmDeviceName, $dmSpecVersion, $dmDriverVersion, $dmSize,
          $dmDriverExtra, $dmFields, ...) = unpack 'C32S4I...', unpack ('P', 
$mode);;           

I've never dealt with a ptr to a ptr so ...

-- 
   ,-/-  __      _  _         Bill Luebkert     Mailto:[EMAIL PROTECTED]
  (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to