James:

Thanks for the response. I learned that in the Microsoft KB article I mentioned
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;q188716), and I did
attempt to make a wrapper property that returned the proper object, with no
avail.  The method I used is described in the article (work around 1). It did
did fix my problem from within VBScript, but I'm left with a different
problem from within Perl:

---
     my $A = new Win32::OLE("Test.TestClass2");
     my $B = $A->{TestProp};
---

$B should be the correct object now (TestClass1), but instead _seems_ to be
equal to $A (TestClass2).  I emphasize seems, because I'm not entirely sure
what it is. When I try to call a method using $B, I get:

    Win32::OLE(0.1502) error 0x80020003: "Member not found"
        in METHOD/PROPERTYGET "" at testole.pl line 17

Maybe this work around method isn't enough for Win32::OLE? Again, any ideas
would be extremely appreciated. 

Thanks!

- Amir

On Tue, Feb 19, 2002, Tillman, James wrote:

> 
> 
> > -----Original Message-----
> > From: Amir Kashani [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 19, 2002 3:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Win32::OLE ...
> ...
> > Win32::OLE(0.1502) error 0x80020003: "Member not found"
> >     in METHOD/PROPERTYGET "" at testole.pl line 17
> > 
> > Isn't it kind of odd that the actual method isn't there? I 
> > don't know what if
> > anything that means.
> > 
> > Thanks!
> > 
> > - Amir
> 
> Amir:  I had trouble with this same thing recently.  The problem is that
> Win32::OLE has a limitation in that it cannot use custom OLE interfaces,
> only IDispatch.  In plain language, VB creates what is called a "custom
> interface" whenever you use the "Implements" keyword.  This custom interface
> is inaccessible not only to Perl's Win32::OLE module, but also to VBScript
> and Javascript.
> 
> I ran into this recently when trying to use Perl's Test::Unit modules to
> unit test a VB component.  I couldn't run the tests from Perl due to the
> custom interface.
> 
> One workaround, with the emphasis on "work", is to create either a wrapper
> class that provides methods of the same name as the interface you're trying
> to access, and then delegates those method calls to an internally held
> instance of the custom interface component.  In your case, you would have a
> class called Test.TestClass3 which looks like this:
> 
> ---
> 
> Private tc2 as Test.TestClass2
> 
> Public Function Test(ByVal Username As String, ByVal Password As String)
>       Test = tc2.Text(Username, Password)
> End Function
> 
> ---
> 
> As an alternative, you could place these wrapper methods directly in the
> TestClass2 class, but it might clutter things up a bit...  I realize this is
> a terrible kludge, and may be more work than its worth in your particular
> situation.
> 
> Hope this helps out.
> 
> jpt

----- End forwarded message -----
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to