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?

    In reply to wrestling with .NET application via perl by trillich

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.