Argument passing between perl and a C function.

There is C function in a OLE server:
What kind of variable should I pass to this function?
#########################################################################
BOOL Calculate(BSTR* names, double* values, short number_of_names);


I tried the following script, but there is always an error like "Type
mismatch" ...
Is there any simple way to pass argument between perl and C function?
#########################################################################
#! perl -W


use strict;
use Win32::OLE;
use Win32::OLE::Variant;


my $names = Variant(VT_BSTR|VT_ARRAY, 3);
my $values = Variant(VT_R8|VT_ARRAY, 3);


$names->Put(['name1', 'name2', 'name3']);
$values->Put([0, 0, 0]);


my $ret = $app->Calculate($names, $values, 3);

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to