The information in this article applies to:
SYMPTOMS
In a RPC server application, calls to any OLE APIs that cause an interface
to be marshalled will fail if the application has already called
RpcServerListen. In particular, CoGetClassObject and CoCreateInstance fail
with E_OUTOFMEMORY even though CoInitialize succeeded and the object is
registered correctly. CAUSEOLE is also acting as a RPC server. If the application calls RpcServerListen or RpcMgmtWaitServerListen before OLE calls RpcServerListen, OLE's call to RpcServerListen will return RPC_S_ALREADY_LISTENING. This is correct behavior in a RPC server application because RPC allows only a single thread to block waiting for RPC client requests. Unfortunately, OLE treats this return value as an error rather than success. RESOLUTION
To instantiate and use COM objects in an RPC server application, you need
to force OLE to call RpcServerListen first. The application should then
expect its own call to RpcServerListen to return RPC_S_ALREADY_LISTENING,
which should be treated as success. STATUSThis behavior is by design. MORE INFORMATION
An RPC server application receives RPC calls via the RPC libraries, which
create a pool of threads for dispatching RPC calls within the server
application. An incoming call is assigned to a thread from the pool, which
unmarshals the parameters and calls the appropriate RPC interface method in
the server. This allows multiple RPC calls to be serviced simultaneously. Additional query words: 2.0 2.00 4.00
Keywords : kbole kbNTOS351 kbWinOS95 kbGrpCom kbDSupport LeTwoCom |
Last Reviewed: October 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |