内容:Office 2007,ExcelDNA 0.30,ActiveState Perl SDK 3.0,PerlNET
我正在尝试使用PerlNET编写ExcelDNA加载项。我们的想法是写一些可以处理可变数量参数的东西,比如= SUM()。
Perl代码:
#!perl
package AddIn;
use strict;
use diagnostics;
use namespace "System";
use PerlNET qw(AUTOCALL);
=for interface
[interface: pure]
static double PNSUM(double);
static double PNSUM(double,double);
static double PNSUM(double,double,double);
static double PNSUM(double,double,double,double);
static double PNSUM(double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
static double PNSUM(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double);
=cut
sub new {
my($package) = @_;
my $self = bless {} => $package;
return $self;
}
sub PNSUM {
my $result = 0.0;
foreach (@_) {
$result += $_;
}
return $result;
}
#~ print SUM(1.9,2.8,3.7,4.6,5.5,6.4,7.3,8.2,9.1);
DNA代码
<DnaLibrary Name="Perl NET Demo" RuntimeVersion="v2.0">
<ExternalLibrary Path="BOPN.DLL" />
</DnaLibrary>
.XLL文件加载正常,但PNSUM()不可见。我做错了什么?