use Win32::API; my $DataToEncode = "Test1 Test2 Test3"; my $return_sring = undef; use Win32::API; $function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'] ); my $string = $function->Call('FontEncode'); #### $function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P' ); #### $function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P', '_cdecl' ); #### $function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P', '__stdcall' ); #### my $string = $function->Call($str1, $n1, $n2, $n3, $str2); #### my $string = '' x 500; # Big enough ? $string = $function->Call($str1, $n1, $n2, $n3, $str2);