IMarshal::UnmarshalInterface

Initializes a newly created proxy and returns an interface pointer to that proxy.

HRESULT IMarshal::UnmarshalInterface(

IStream * pStm,
//Stream used for unmarshaling
REFIID riid,
//IID of interface pointer desired
void ** ppv
//Receives the interface pointer
);

Parameters

pStm

[in]Points to the stream from which the interface pointer is to be unmarshaled.

riid

[in]Specifies the IID of the interface pointer desired.

ppv

[out]Receives the interface pointer.

Return Values

S_OK

The interface pointer was unmarshaled successfully.

E_FAIL

Indicates that the implementation failed.

E_NOINTERFACE

The specified interface was not supported.

Comments

This method is called from the receiving side (that is; the side doing the unmarshaling). This method is called on the proxy object itself; that is; the object whose CLSID was returned by IMarshal::GetUnmarshalClass.

Notes to Implementors

Your implementation should read the data written to the stream by your implementation of IMarshal::MarshalInterface and use that data to initialize the proxy object.

To return the appropriate interface pointer; your implementation can simply call IUnknown::QueryInterface on itself, passing the riid and ppv parameters. However; your implementation is free to create a different object and return a pointer to that object; if you find it necessary.

Just before exiting; your implementation should position the seek pointer in the stream immediately after the last byte of data read. This should be done even if the method exits with an error.

See Also

IMarshal::GetUnmarshalClass, IMarshal::MarshalInterface

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database