Share via


IMediaObjectImpl::LockIt Class

 
Microsoft DirectShow 9.0

IMediaObjectImpl::LockIt Class

The LockIt class is an internal class that locks and unlocks the DMO.

Syntax

  LockIt(
    _DERIVED_ *
  p

  );

Parameters

p

Pointer to the derived object.

Remarks

The LockIt constructor locks the DMO, and the destructor unlocks the DMO. To lock the object from inside your derived class, declare a local variable of type LockIt. The DMO is locked while the LockIt object remains in scope:

void SomeMethod()
{
    // The DMO is not locked.
    {
        LockIt dmoLock(this); // Locks the DMO.
        /* ... */
    } 
    // dmoLock goes out of scope, DMO is unlocked.
}

The methods in IMediaObjectImpl automatically lock the DMO.

Requirements

  Header: Dmoimpl.h
  Library: Dmoguids.lib, Msdmo.lib

See Also