Initializes a newly created proxy and returns an interface pointer to that proxy.
HRESULT UnmarshalInterface(
IStream * pStm, //Pointer to the stream to be unmarshaled
REFIID riid, //Reference to the identifier of the interface to
//be unmarshaled
void ** ppv //Address of output variable that receives the
//interface pointer requested in riid
);
The method supports the standard return value E_FAIL, as well as the following:
The COM library in the process where unmarshaling is to occur calls the proxy's implementation of this method.
You do not call this method directly. There are, however, some situations in which you might call it indirectly through a call to CoUnmarshalInterface. For example, if you are implementing a stub, your implementation would call CoUnmarshalInterface when the stub receives an interface pointer as a parameter in a method call.
The proxy's implementation should read the data written to the stream by the original object's implementation of IMarshal::MarshalInterface and use that data to initialize the proxy object whose CLSID was returned by the marshaling stub's call to the original object's implementation of IMarshal::GetUnmarshalClass.
To return the appropriate interface pointer, the proxy implementation can simply call IUnknown::QueryInterface on itself, passing the riid and ppv parameters. However, your implementation of UnmarshalInterface is free to create a different object and, if necessary, return a pointer to it.
Just before exiting, even if exiting with an error, your implementation should reposition the seek pointer in the stream immediately after the last byte of data read.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IMarshal::GetUnmarshalClass, IMarshal::MarshalInterface