Re: Non-creatable classes
Actually, it's essential for VB programmers if the object
has an outgoing interface (events in VB lingo). E.g. the
coclass has a [default, source] (disp)interface.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:%23ZXy9SIRHHA.1228@TK2MSFTNGP06.phx.gbl...
Ignacio Burgue?o <blabla@blabla.com> wrote:
I have a com server which returns new instances of class A. I don't
want A to be createable. Only when requesting it to my server. So,
following the article on private hierarchies, I removed its .rgs
file, deleted its OBJECT_ENTRY and DECLARE_REGISTRY_RESOURCEID. So
far, so good. My question is: what's the difference between leaving the
definition
of the coclass A in the IDL and marking it as [noncreatable], and
removing the definition from the IDL, and not inheriting from
CComCoClass ?
Not much. Some languages, most notably VB, can use coclass name as a
synonym for its default interface when they see coclass statement in the
TLB. VB programmers like this, for some reason.
It also can be viewed as a means of documentation.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925