IRunningObjectTable::Register

HRESULT IRunningObjectTable::Register(reserved, pUnkObject, pmkObjectName, pdwRegister)

Register the fact that the object pUnkObject has just entered the running state and that if the moniker pmkObjectName is bound to, then this object should be used as the result of the bind (with an appropriate QueryInterface).

The moniker pmkObjectName should be fully reduced before registration. See IMoniker::Reduce for a more complete discussion. If an object goes by more than one fully reduced moniker, then it should register itself under all such monikers. Here, fully reduced means reduced to the state MKRREDUCE_THROUGUSER.

Registering a second object under the same moniker sets up a second independent registration, though MK_S_MONIKERALREADYREGISTERED is returned instead of S_OK. This is done without regard to the value of pUnkObject in the second registration; thus, registering the exact same (pmkObjectName, pUnkObject) pair a second time will set up a second registration. It is not intended that multiple registration under the same moniker be a common occurrence, as which registration actually gets used in various situations is non-deterministic.

The arguments to this function are as follows:

Argument

Type

Description

reserved

DWORD

Reserved for future use; must be zero.

pUnkObject

IUnknown*

The object which has just entered the running state.

pmkObjectName

IMoniker*

The moniker which would bind to the newly running object.

pdwRegister

DWORD*

A place to return a value by which this registration can later be revoked. May not be NULL. Zero will never be returned as a valid registration value; that is, on exit, *pdwRegister is never NULL.

return value

HRESULT

S_OK, MK_S_MONIKERALREADYREGISTERED