STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Thread Marshal Functions
[COMSTL]

These functions assist in the marshaling of components between threads and processes. More...

Functions

template<typename I> HRESULT MarshalInterThreadInterfaceInStream (I *pitf, LPSTREAM *ppstm)
 Marshal a interface to a stream.

template<typename I> HRESULT GetInterfaceAndReleaseStream (LPSTREAM pstm, I **ppitf)
 Retrieve a marshaled interface pointer from a stream.


Detailed Description

These functions assist in the marshaling of components between threads and processes.


Function Documentation

HRESULT GetInterfaceAndReleaseStream LPSTREAM    pstm,
I **    ppitf
[inline]
 

Retrieve a marshaled interface pointer from a stream.

This function loads a serialised marshalled interface pointer from the given stream, queries for the interface of the given pointer, and returns the pointer if successful, and an error code if not. The stream is always released, irrespective of the success status of the function as a whole.

Parameters:
pstm  An IStream pointer from which object is to be unmarshaled
ppitf  A pointer to the interface pointer to be unmarshaled
Returns:
An HRESULT indicating success or failure
Return values:
E_INVALIDARG  The argument was invalid
S_OK  The operation completed successfully

HRESULT MarshalInterThreadInterfaceInStream I *    pitf,
LPSTREAM *    ppstm
[inline]
 

Marshal a interface to a stream.

This function marshals the given interface into a new stream instance, which is returned to the caller. The stream may then be passed directly to another thread in the process, from which GetInterfaceAndReleaseStream() may be called.

Parameters:
pitf  The interface pointer to marshal
ppstm  A pointer to an IStream pointer to receive the stream
Returns:
An HRESULT indicating success or failure
Return values:
E_OUTOFMEMORY  Sufficient memory could not be acquired
S_OK  The operation completed successfully

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004