Woo hoo, yes indeed! That did the trick. Thanks, Jan!

BTW -- Jan, I don't recall the last time I posted a newbie-ish question and
got as much information-packed help as what you've been providing here.
Kudos! Thanks a bunch, keep up the good work...


On Wed, Dec 16, 2009 at 6:42 PM, Jan Dubois <[email protected]> wrote:

> Ok, here is what Graham from ActiveState support tells me:
>
>
>
> You *may* also need to go to the “Security” tab in the “Internet Options”,
> select “Local intranet” and click on the “Sites” button.  Then disable the
> “Automatically detect intranet network” and instead select the individual
> choices underneath manually.
>
>
>
> I wonder if we shouldn’t drop the OLE browser from ActivePerl; it is hard
> to get it working, and enabling it leaves you with a security vulnerability
> unless you can trust all web pages on your local intranet.
>
>
>
> Note that both Microsoft Visual Studio and Microsoft Office come with
> Object browsers themselves, so if you have either of them, it might be
> easier to use those browsers instead (the Win32::OLE browser is basically a
> re-implementation of the one from Office 97 in Perl and DHTML).
>
>
>
> Cheers,
>
> -Jan
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On Behalf Of *
> [email protected]
> *Sent:* Wednesday, December 16, 2009 3:11 PM
> *To:* Jan Dubois
> *Cc:* [email protected]
> *Subject:* PerlScript OLE browser [was How to simulate VB "Casting" for
> $perl_objects via Win32::OLE?]
>
>
>
> Thanks Jan. We've got the .NET wonks working on just this approach.
>
> BTW... what does it take to get the PerlScript OLE browser to work? I tried
> a quick test (below) and PerlScript is working in IE, but the OLE browser
> frames are all empty except for the default "could not load" gripe at the
> bottom. Is there a start-condition of some sort? (And "Initialize and script
> ActiveX controls not marked as safe" is set to "Enable" for the local
> intranet zone...)
>
>
>
> <script language="PerlScript">
>
> $window->{status} = 'Hi from PerlScript!'; # works!
>
> </script>
>
>
>
> http://www.xav.com/perl/site/lib/Win32/OLE/Browser/Browser.html
>
> file:///C:/Perl/html/lib/Win32/OLE/Browser.html
>
>
>
>
>
> On Wed, Dec 16, 2009 at 2:10 PM, Jan Dubois <[email protected]> wrote:
>
> Win32::OLE uses late binding (the IDispatch interface, aka OLE Automation);
> there is no such thing as casting to different “objects” as there is only a
> single IDispatch interface per object.  This is the same as using Jscript or
> VBScript, but not VB or C++ which normally use early binding.
>
> It is up to the developer of the object to make sure all interfaces are
> automation accessible.  Ask them for sample code in VBScript or VBA.  If you
> cannot access the interfaces from there, then you won’t be able to access
> them via Win32::OLE either.
>
>
>
> Cheers,
>
> -Jan
>
>
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *
> [email protected]
> *Sent:* Wednesday, December 16, 2009 11:40 AM
> *To:* [email protected]
> *Subject:* How to simulate VB "Casting" for $perl_objects via Win32::OLE?
>
>
>
> Hi --
>
>
>
> Short version: how can we simulate .NET/VB object-type CASTing, in
> Win32::OLE Perl?
>
>
>
> Long version:
>
>
>
> We're building a bridge between a java-web-app and a .net-based-desktop
> app. Perl is the glue language of choice, of course :)
>
>
>
> Where we've got trouble is that the .net programmers tell us we need to
> "cast" object_1 to be type object_2, and we haven't see how that's done in
> the Win32::OLE manual pages.
>
>
>
> For example we start with a Collection, iterate through
> CoursesCollection->Item(ix) and from there we get a
> StudentsCollection->Item( foo ) which is a generic object but needs to be
> CAST as a 'proper' Student object instead. How do we do that in Win32::OLE?
>
> my $classes = App->Classes;
>
> my $class_ct = $classes->Count;
>
> for ( my $class_ix = 1; $class_ix <= $class_ct; $class_ix ++ ) {
>
>   my $class = $classes->Item( $class_ix );
>
>
>
>   my $students = $class->Students;
>
>   my $stu_ct = $students->Count;
>
>   for ( my $stu_ix = 1; $stu_ix <= $stu_ct; $stu_ix ++ ) {
>
>     my $stu = $students->Item( $stu_ix );
>
>
>
>    # $stu is a GENERIC object here with only basic methods
>
>    # need to 'cast' it to "Student" type so we can get grades
>
>    my $grades = $stu->Grades; # boom! (Name not found, meaning no such
> method)
>
>   }
>
> }
>
>
>
> We were hoping the objects were classed somehow inside Perl, but all
> objects appear to be simply Win32::OLE objects, and even trying to get to
> the hash keys gives an error...
>
>
>
> Any pointers/flames welcome. Thanks!
>
>
> --
> will trillich
> "Tis the set of the sails / And not the gales / That tells the way we go."
> -- Ella Wheeler Wilcox
>
>
>
>
> --
> will trillich
> "Tis the set of the sails / And not the gales / That tells the way we go."
> -- Ella Wheeler Wilcox
>



-- 
will trillich
"Tis the set of the sails / And not the gales / That tells the way we go."
-- Ella Wheeler Wilcox
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to