IPSFactoryBuffer::CreateStub

HRESULT IPSFactoryBuffer::CreateStub(iid, pUnkServer, ppStub)

Create a new interface stub object. The stub is created in the connected state on the object indicated by pUnkServer.

If pUnkServer is non-NULL, then before this function returns the stub must verify (by using QueryInterface()) that the server object in fact supports the interface indicated by iid. If it does not, then this function should fail with the error E_NOINTERFACE.

Argument

Type

Description

iid

REFIID

The interface that the stub is being created to service

pUnkServer

IUnknown*

The server object that is being remoted. The stub should delegate incoming calls (see IRpcStubBuffer::Invoke()) to the appropriate interface on this object. pUnkServer may legally be NULL, in which case the caller is responsible for later calling IRpcStubBuffer::Connect() before using IRpcStubBuffer::Invoke().

ppStub

IRpcStubBuffer**

The place at which the newly create stub is to be returned.

return value

HRESULT

S_OK, E_OUTOFMEMORY, E_NOINTERFACE, E_UNEXPECTED, no others.