Platform SDK: MAPI

IMAPIFormFactory::LockServer

The IMAPIFormFactory::LockServer method keeps an open form server in memory.

Quick Info

See IMAPIFormFactory : IUnknown.

HRESULT LockServer(
  ULONG ulFlags,     
  ULONG fLockServer  
);
 

Parameters

ulFlags
Reserved; must be zero.
fLockServer
[in] Variable set to TRUE if the lock count is to be incremented, and FALSE otherwise.

Return Values

S_OK
The call succeeded and has returned the expected value or values.

Remarks

Form viewers call the IMAPIFormFactory::LockServer method to keep an open form server application in memory. Keeping the form server in memory improves its performance when forms are created and released frequently.

Notes to Implementers

The LockServer method is very similar to the IClassFactory::LockServer method. Essentially, this method maintains a count of how many times it has been called and as long as that count is greater than 0, prevents the form server from being unloaded from memory. You can use the OLE function CoLockObjectExternal to implement this. See the OLE Programmer's Reference for details.