...
Code Block | ||
---|---|---|
| ||
bool QueryInitInterfaces(ComponentEntry* Entry, bool bLastChance) { return hasComms && hasPersistence; } int Notify(DWORD dwWhat, ComponentEntry* Entry, void* pData) { if(dwWhat != COMPONENT_NOTIFY_NEWINTERFACE) { return 0; } ComponentInterfaceEntry* pInterface = (ComponentInterfaceEntry*)pData; if(IsEqualGUID(pInterface->guid, HOST_COMMS_INTERFACE_UUID)) { hasComms = true; return 0; } if(IsEqualGUID(pInterface->guid, PERSISTENCE_PROVIDER_INTERFACE_UUID)) { hasPersistence = true; return 0; } } |
In the above example, once the host comms and persistence provider interfaces have been registered, your component will return true from ComponentEntry.QueryInitInterfaces and the framework then knows it can safely call your ComponentEntry.InitInterfaces callback.