Want to active another plugin, but dont know how to do
Someone do me a favor to tell me ?
How to use these:
virtual service_base * service_enum_create(const GUID &g,int n)=0;
virtual int service_enum_get_count(const GUID &g)=0;
and another one in service.h
static service_base * enum_create(const GUID &g,int n);
There are some examples in the SDK of how to use the enumerations. (Or so Peter says. I haven't actually looked.)
Basically, there is no way to enumerate the plugins, because there is no "plugin" base class. You can enumerate the context menu items or the components menu items, though.
You don't need to call those functions directly. If you would like to enumerate implementations for some foo service, you can use code like this:
service_enum_t<foo> e;
foo * ptr;
for(ptr=e.first();ptr;ptr=e.next())
{
/* do something with ptr here */
ptr->service_release();
}
Of course you can also store the values returned by e.first(), and release them later. You also don't need to iterate until e.first() returns 0.
thx!