Generating Active/X Wrapper Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating Active/X Wrapper Question

Jeffrey Odell-2
Is it possible to specify an IDispatch subclass to the Active/X Component
Wizard? I would like all the classes it generates to be generated as
subclasses under this class. This would allow me to find things easier in
the Class Browser, and also add some component specific behavior to that
superclass (perhaps licensing or other helpful methods).

jlo


Reply | Threaded
Open this post in threaded view
|

Re: Generating Active/X Wrapper Question

Blair McGlashan
Jeffrey

You wrote in message
news:[hidden email]...
> Is it possible to specify an IDispatch subclass to the Active/X Component
> Wizard? I would like all the classes it generates to be generated as
> subclasses under this class. This would allow me to find things easier in
> the Class Browser, and also add some component specific behavior to that
> superclass (perhaps licensing or other helpful methods).

No (unless the type library already groups the interfaces, as for example
ADO does), although I agree that it would be useful. In fact this isn't even
possible programmatically, at least without modifying the type library
analyzer code (not that it would be hard to do that in this case).

What you can do though is to just move them around yourself by just dragging
and dropping them in the browser, or by running an expression such as:

    MyTypeLib interfaces do: [:e | e global superclass == IDispatch ifTrue:
[ClassBuilder moveClass: e global toSuperclass: MyIDispatch]]

Once they have been relocated, the wizard/analyzer will not subsequently
move them back even if they are regenerated.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Generating Active/X Wrapper Question

Jeffrey Odell-2
Worked like a champ - thanks -

jlo

"Blair McGlashan" <[hidden email]> wrote in message
news:9albrf$5m68d$[hidden email]...
> Jeffrey
>
> You wrote in message
> news:[hidden email]...
> > Is it possible to specify an IDispatch subclass to the Active/X
Component
> > Wizard? I would like all the classes it generates to be generated as
> > subclasses under this class. This would allow me to find things easier
in
> > the Class Browser, and also add some component specific behavior to that
> > superclass (perhaps licensing or other helpful methods).
>
> No (unless the type library already groups the interfaces, as for example
> ADO does), although I agree that it would be useful. In fact this isn't
even
> possible programmatically, at least without modifying the type library
> analyzer code (not that it would be hard to do that in this case).
>
> What you can do though is to just move them around yourself by just
dragging
> and dropping them in the browser, or by running an expression such as:
>
>     MyTypeLib interfaces do: [:e | e global superclass == IDispatch
ifTrue:

> [ClassBuilder moveClass: e global toSuperclass: MyIDispatch]]
>
> Once they have been relocated, the wizard/analyzer will not subsequently
> move them back even if they are regenerated.
>
> Regards
>
> Blair
>
>