Howdy: I wrote a dll in VB and I have a perl script that is calling it. In the dll I build a Scripting.Dictionary and I want to return it to the Perl script. I cannot get this to work for the life of me. The following is the VB method that I a trying to call:

Public Function returnScriptingObj1() As Object Dim tot As Object Dim debugFile As Integer debugFile = FreeFile Open "d:\debug1.txt" For Output As #debugFile Print #debugFile, "TEST" Set tot = CreateObject("Scripting.Dictionary") tot.Add "tom", "daddy" tot.Add "Ginger", "mommy" tot.Add "Caroline", "kiddy" Close #debugFile Set returnScriptingObj1 = tot 'returnScriptingObj1 = tot End Function

The following is the Perl code:
my $newObj = Win32::OLE->new("TestArray.PArray"); my $resultsArray; #= Variant(VT_BYREF, Variant(VT_EMPTY)); $resultsArray = $newObj->returnScriptingObj1(); print Dumper($resultsArray);<br>
The following is the output from the perl code above:
$VAR1 = bless( { 'Item' => undef, 'Count' => 3, 'CompareMode' => 0 }, 'Win32::OLE' );
First is it possible to get the Scripting.Dictionary object back to the Perl script? If so, what is missing?
Please help...
Thanks, Tom

Edit: added <code> tags. larsen


In reply to Returning a VB ScriptingObject to Perl app by Anonymous Monk

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.