Thanks to the wisdom of the Monks who helped me before, I have Win32::OLE working. I have found several examples of controlling Excel and Word and have been able to make them work.

Now I'm trying to get started on my real application and am once again in need of understanding and enlightenment.

The problem is that the application I want to access is a non-Microsoft program from a third party and which doesn't provide a lot in the way of documentation. I have some VB examples, but I'm not having much success translating them to Perl.

I use OLE-Browser and see the library (HALiCnt) that contains the functions I want to access. I see the class (HALi) and Function {Function Init() As Boolean}. But the rub is that I don't know what the Application Name is. That is when creating the OLE Server Object:

my $server = WIn32::OLE->new('xxx.Application')
Nothing I can put in for the xxx seems to be right. I think what I am looking for here is the 'Root name' if I interpret some documentation I have seen correctly, so I guess the question is "How do I find the Root Name of an arbitrary server?"

I have also tried many different combinations of GetActiveObject as well as new to no avail. The usual error is something like "invalid Class String"

I have searched the tutorials in the Monastery, as well as CPAN and so on, but every tutorial seems to assume I want to control Excel, Word or some other such application.

Is there a good document on interfacing to an arbitrary application about which little is known? How about something on taking VB OLE examples and translating them to Perl. I know about arrows instead of dots and such, but not much more.

I fear I am going to be forced to learn VB and to write my application in VB unless the Monks can show me the way.

Thanks,

Nathan


In reply to More on OLE from Perl by wa4otj

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.