Why would the ActiveX wizard not generate a clsid class method?

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

Why would the ActiveX wizard not generate a clsid class method?

Paul Hudson
[Disclaimer: I'mm very close to having no idea at all what I'm
doing here ;-/ so feel free to just point me at documentation]

I've been trying to use the NNTP controls found here:
http://uwekel.bei.t-online.de/nntp.htm

It contains 3 controls: Nntp, Mime, and MultiNntp.

When I  use the active X wizard, only the last of these has a
clsid class method (and so I can create an instance). The
others give me a walkbalk.

What am I doing wrong?

P.


Reply | Threaded
Open this post in threaded view
|

Re: Why would the ActiveX wizard not generate a clsid class method?

Blair McGlashan
"Paul Hudson" <[hidden email]> wrote in message
news:Xns920DD5F3CD039phudsonpoboxcom@127.0.0.1...

> [Disclaimer: I'mm very close to having no idea at all what I'm
> doing here ;-/ so feel free to just point me at documentation]
>
> I've been trying to use the NNTP controls found here:
> http://uwekel.bei.t-online.de/nntp.htm
>
> It contains 3 controls: Nntp, Mime, and MultiNntp.
>
> When I  use the active X wizard, only the last of these has a
> clsid class method (and so I can create an instance). The
> others give me a walkbalk.

The wizard is only able to deduce the CLSID to be associated with an
interface when that interface is listed as the "default" interface for
precisely one instantiable coclass. If there is no such information in the
type library, then the #clsid method is not generated. In this case it
appears that only one of the classes in the typelibrary is marked as
instantiable/creatable (that is the typeinfo for the coclass has the
attribute TYPEFLAG_FCANCREATE - see MSDN for further details on that if
interested), hence only one clsid method. This is presumably an error in the
type library (which seems to have been generated by VB), but you can
manually add the clsid methods - just pull the uuid's associated with the
coclasses at the end of the IDL; either use the wizard to 'Browse IDL', or
use Microsoft's OLEVIEW tool) out and create appropriate #clsid methods like
this:

!Nws_Nntp class methodsFor!

clsid
 ^CLSID fromString: '{2655045D-7AAC-432E-82DB-D55D81ED6920}'! !
!Nws_Nntp class categoriesFor: #clsid!constants!public! !

Here I've generated the interfaces with an Nws prefix. The object does seem
to be creatable by the way, so have fun...

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Why would the ActiveX wizard not generate a clsid class method?

Paul Hudson
> either use the wizard to
> 'Browse IDL',

I'm presumably missing something obvious, but how do I do this
with the wizard?

> !Nws_Nntp class methodsFor!
>
> clsid
>  ^CLSID fromString:
>  '{2655045D-7AAC-432E-82DB-D55D81ED6920}'! !
> !Nws_Nntp class categoriesFor: #clsid!constants!public! !
>
> Here I've generated the interfaces with an Nws prefix. The
> object does seem to be creatable by the way, so have fun...

Worked fine. Thanks!

P.


Reply | Threaded
Open this post in threaded view
|

Re: Why would the ActiveX wizard not generate a clsid class method?

Andy Bower
Paul,

> > either use the wizard to
> > 'Browse IDL',
>
> I'm presumably missing something obvious, but how do I do this
> with the wizard?

Right click on the particular ActiveX component in the ActiveX Component
Wizard and choose "Browse IDL" from the context menu.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---