This is a bit long and convoluted, so bear with me. No code yet - the problem is that I don't see where to start tackling this problem.

Initial problem - I have an ancient VB6 app that embeds several Internet Explorer ActiveX objects. Recently, I needed to embed some form of scripting to it, and decided to use my favorite language. A few hours later, I had created an ActiveX control using Activestate's PerlCtrl app, and had it loading scripts and interacting with the IE control (among other parts of the app).

All good. Works great... Until I come to the part where I need to interact with frames embedded within those controls. IE's security model doesn't let you interact with the document under those controls directly. You have to use the IOleContainer interface to enumerate the control, then get the IWebBrowser2 interface of the enumerated objects. (see This for details).

AFAIK, Win32::OLE doesn't support getting random interfaces - it uses IDispatch, IVariant, and those ilk for the heavy lifting.

Well, I thought, I'll create some XS, pass the WebBrowser pointer to it, do the ugly stuff, then pass it back, somehow creating a Win32::OLE object. That's nice, except for two parts - getting the right pointer, and getting it back into an Win32::OLE object. Win32::OLE does appear to store the right interface pointer, but not anywhere I can see a way to get at it without compiling my own version of it. Even then, I'll have to create the Win32::OLE object with some convulutions.

Then I considered writing a COM control in C/C++, and got as far as writing the first few lines of C++ before I realized that I'll still need the original object to pass it through.

Finally, I decided that I would ask some perl gurus before I started writing this monstrosity. Has anyone ever come across something like this, another approach, or can think of a better way to accomplish this, or of some detail that I am currently missing?


In reply to Internet Explorer Frames - Win32::OLE by TheDauthi

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.