Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.7 KiB

  1. //
  2. // CDocumentInputManager.cpp
  3. //
  4. #include "private.h"
  5. #include "dim.h"
  6. #include "globals.h"
  7. #include "tim.h"
  8. #include "emptyic.h"
  9. DBG_ID_INSTANCE(CDocumentInputManager);
  10. /* dca73cc8-e2ed-48c4-8b25-ba2e9908095f */
  11. extern const IID IID_PRIV_CDIM = { 0xdca73cc8, 0xe2ed, 0x48c4, {0x8b, 0x25, 0xba, 0x2e, 0x99, 0x08, 0x09, 0x5f} };
  12. //+---------------------------------------------------------------------------
  13. //
  14. // ctor
  15. //
  16. //----------------------------------------------------------------------------
  17. CDocumentInputManager::CDocumentInputManager()
  18. : CCompartmentMgr(g_gaApp /* Issue */, COMPTYPE_DIM)
  19. {
  20. Dbg_MemSetThisNameID(TEXT("CDocumentInputManager"));
  21. Assert(_peic == NULL);
  22. _iStack = -1;
  23. }
  24. //+---------------------------------------------------------------------------
  25. //
  26. // dtor
  27. //
  28. //----------------------------------------------------------------------------
  29. CDocumentInputManager::~CDocumentInputManager()
  30. {
  31. // stack should have been cleared in CThreadInputMgr::RemoveDocumentInputMgr
  32. Assert(_iStack == -1);
  33. SafeRelease(_peic);
  34. //
  35. // remove this from dim ptr array of TIM.
  36. //
  37. CThreadInputMgr *tim;
  38. if (tim = CThreadInputMgr::_GetThis())
  39. {
  40. int i = 0;
  41. int nCnt = tim->_rgdim.Count();
  42. CDocumentInputManager **ppdim = tim->_rgdim.GetPtr(0);
  43. while (i < nCnt)
  44. {
  45. if (*ppdim == this)
  46. {
  47. tim->_rgdim.Remove(i, 1);
  48. break;
  49. }
  50. i++;
  51. ppdim++;
  52. }
  53. tim->GetDimWndMap()->_Remove(this);
  54. }
  55. }