perl-win32-gui-users list,

I wrote:
> But how do I find and read the [COPYDATASTRUCT] structure pointed
>    to by the integer $lParam ?

Well, I figured it out.
Here's a sub, not completely general, but handles the case
of a scalar message string.

Thanks for your indulgence.
(Maybe this will be useful for someone else searching the list archive.)

Cheers,
-Len

use Tie::Array::Pointer ;

sub read_COPYDATASTRUCT {
   ## input: $CopyData_p   (eg from an lParam)
   ## output (scalar): $Msg    (list): ($Msg, dwData_p)
   my $CopyData_p = shift ;

   my @CopyData_a ;
   tie @CopyData_a, 'Tie::Array::Pointer',
      {length => 3,    type   => 'L',    address => $CopyData_p } ;
   my ($dwData_p, $cbData_len, $lpData_p) = @CopyData_a ;

   my @Msg_a ;
   tie @Msg_a, 'Tie::Array::Pointer',
      {length => $cbData_len,  type   => 'C',  address => $lpData_p } ;

   pop @Msg_a if @Msg_a[-1] eq "\0" ;    ## pop off trailing null   (more??)
   my $Msg = pack "C$#Msg_a", @Msg_a ;
   wantarray ? ($Msg, $dwData_p)  : $Msg ;
}



On Jul 17, 2009, l...@weisberg.com wrote:

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to