in reply to Re^2: dll calling problems
in thread dll calling problems

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');
There are still some inconsistencies in the above code - and these inconsistencies may be preventing the thing from working (there might also be Win32::API bugs that mean it's never gunna work anyway).

I think you still need to specify the return type in new:
$function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P' );
You could also try the 2 following renditions:
$function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P', + '_cdecl' );
and
$function = Win32::API->new( 'IDAutomationDMATRIX6', 'FontEncode',['P','N','N','N','P'], 'P', + '__stdcall' );
Since FontEncode takes 5 arguments, Call() also needs to be given 5 arguments - a string, an int, an int, an int, and a string (in that order):
my $string = $function->Call($str1, $n1, $n2, $n3, $str2);
Finally, $string may need to be large enough to accommodate the return string:
my $string = '' x 500; # Big enough ? $string = $function->Call($str1, $n1, $n2, $n3, $str2);
Without access to the dll it's hard to provide good assistance. If you can't get anywhere with it using Win32::API, then VB might be your best approach.

XS/Inline::C would also be options - and they provide excellent milage. I far prefer Inline::C over Win32::API, any day. However, for that to be an option, you also need the relevant header (.h) file and import lib (.lib) - as well as a Microsoft C compiler. (Actually, MinGW usually works fine, too - and doesn't even need the import lib. But I don't think you can use MinGW where COM is involved.)

Cheers,
Rob