Discussion:
[xplc-general] Re: Another question
Pierre Phaneuf
2004-06-25 12:10:03 UTC
Permalink
Bernd Unger wrote:

By the way, I verified that you were subscribed correctly to the XPLC
mailing list and sent this message there. This could be useful for other
people as well!
I shortly looked at the category feature and found it useful for my
purpose, but i'm not sure about how to use it.
Isn't a category something what should be defined inside a component
(dll). So i have some components of a "well known" category in the
dll's and the host should be able to iterate all components of this
category by knowing the "category id" but without knowledge about the
component id?
Yes, this is the principle. Then you can pick one, or instantiate them
all, etc...
In the test010 sample the components are registered by the host
application itself and after this the category is iterated. Is it
possible to write is that way that a component registers under a
category by itself?
Yes. At the moment, this is done by using the "loadModule" variable of
the XPLC_ModuleInfo structure. You should create a function and assign a
pointer to it to that variable, and it will be called when your module
is loaded. This function returns a bool: if it returns false, the module
will be unloaded and ignored. This function can also do things like
register components in a category.

I would like to change this a bit and make category information part of
the XPLC_ModuleInfo structure directly, so that we can have tools that
can look at a module (DLL) and say "it provide components in such and
such categories", for example. It would also allow caching of this
information so that we do not have to load every modules at startup,
thus making the module loader faster (or at least, appearing faster, if
you do eventually end up loading every modules).
--
Pierre Phaneuf
http://ludusdesign.com/~pp/
"I am denial, guilt and fear -- and I control you"
Loading...