IMarshal::GetUnmarshalClass

Returns the CLSID that should be used to create an uninitialized proxy on the receiving side (that is, the side doing the unmarshaling).

HRESULT IMarshal::GetUnmarshalClass(

REFIID riid,
//Identifies the interface being marshaled
void * pv,
//Points to the interface pointer being marshaled
DWORD dwDestContext,
//Identifies the destination process
void * pvDestContext,
//Reserved for future use
DWORD mshlflags,
//Specifies reason for marshaling
CLSID * pCid
//Receives CLSID of proxy
);

Parameters

riid

[in]Specifies the IID of the interface pointer to be marshaled.

pv

[in]Points to the interface pointer to be marshaled; can be NULL.

dwDestContext

[in] Specifies the destination context, that is, the process in which the unmarshaling will be done. Different marshaling can be done depending on whether the unmarshaling will happen on the local workstation or on a workstation on the network; it's possible for an object to do custom marshaling in one case but not another. The legal values for dwDestContext are taken from the enumeration MSHCTX. For information on the MSHCTX enumeration, see the "Data Structures" section.

pvDestContext

[in] Reserved for use with future MSHCTX values.

mshlflags

[in] Specifies why marshaling is taking place. Values for mshlflags are taken from the enumeration MSHLFLAGS. For information on the MSHLFLAGS enumeration, see the "Data Structures" section.

pCid

[out] Receives the CLSID to be used to create a proxy on the receiving side (that is, the side doing the unmarshaling).

Return Value

Returns S_OK if successful; otherwise, S_FALSE.

Comments

This method is called from the originating side (that is, the side doing the marshaling).

Notes to Implementors

The CLSID returned by this method identifies the class of the proxy object. This CLSID is typically written to a stream on the originating side and then read from the stream on the receiving side. Note that if you are creating a copy of the original object in the client process (that is, you are implementing custom marshaling for immutable objects), the CLSID returned is the same one as for the original object.

Your implementation can delegate some destination contexts to the standard marshaling implementation, available by calling the CoGetStandardMarshal API function. You should always delegate if the dwDestContext parameter contains a value that your implementation does not understand; this allows new destination contexts to be defined in the future.

You may want your implementation to use the pointer passed through the pv parameter, and, based on information retrieved from that pointer, determine the appropriate CLSID to return. If the pv parameter is NULL and your implementation needs that interface pointer, it can call IUnknown::QueryInterface on the current object to get it. The pv parameter exists merely to improve efficiency.

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