short version: using blackbaud API
perl script throws an error
VB script throws the same error
simple fix to the VB script gets it to work
how to replicate that fix in the perl script?
long version:
we're stuck, trying to grapple with the interface to a .NET application (blackbaud). it has a well-documented API and some sample scripts (VB) that come with it, which are VB version 6; we only have VStudio 2003pro, so when we upgrade the scripts there's a glitch -- the same exact problems that our
perl attempts have (namely "Startup Error: Failed to load control 'WebHost'") we managed to get a fix working from inside VB, but
we don't know how to replicate that fix using perl... any ideas?
the fix: here's the declaration added to the VB code:
Private Declare Function OleInitialize Lib "ole32" (ByVal reserved As Integer) As Integer
then we can call it before the rest of our app starts up:
OleInitialize(0) 'only needed if no UI shown before init
the minimal perl script we're using -- complete with error dialog -- is:
use Win32::OLE;
use strict;
my $appid = 'AFNAPI7.FE_API';
my $app = Win32::OLE->new($appid)
or die "Canna create new object for $appid";
$app->{SignOutOnTerminate} = 1;
my $login = $app->Init(''); # error dialog here
print "Login results: $login\n\n";
the ideal situation would be to PULL the data from blackbaud on request using perl, instead of PUSHING it from within blackbaud using visual basic, which is, um, not quite as robust a language.
but how to mimic that fix from within perl? using Win32 no doubt, but how? any pointers?