Source code of Windows XP (NT5)
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.

75 lines
1.7 KiB

  1. // MSAAClientAdapter.h : Declaration of the CAccClientDocMgr
  2. #ifndef __MSAACLIENTADAPTER_H_
  3. #define __MSAACLIENTADAPTER_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CAccClientDocMgr
  7. class ATL_NO_VTABLE CAccClientDocMgr :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CAccClientDocMgr, &CLSID_AccClientDocMgr>,
  10. public IAccClientDocMgr
  11. {
  12. public:
  13. CAccClientDocMgr();
  14. ~CAccClientDocMgr();
  15. DECLARE_REGISTRY_RESOURCEID(IDR_ACCCLIENTDOCMGR)
  16. DECLARE_PROTECT_FINAL_CONSTRUCT()
  17. BEGIN_COM_MAP(CAccClientDocMgr)
  18. COM_INTERFACE_ENTRY(IAccClientDocMgr)
  19. END_COM_MAP()
  20. HRESULT FinalConstruct()
  21. {
  22. bool fInit = false;
  23. HANDLE hInit = OpenEvent( SYNCHRONIZE, FALSE, TEXT("MSAA_STORE_EVENT") );
  24. if ( hInit )
  25. {
  26. fInit = true;
  27. CloseHandle( hInit );
  28. }
  29. HRESULT hr = CoCreateInstance( CLSID_AccStore, NULL, CLSCTX_LOCAL_SERVER, IID_IAccStore, (void **) & m_pAccStore );
  30. // if this Event does not exist then the store is being created for the first time
  31. // so lets wait a little bit to let the store settle down.
  32. if ( !hInit )
  33. Sleep (500);
  34. return hr;
  35. }
  36. // IAccClientDocMgr
  37. public:
  38. HRESULT STDMETHODCALLTYPE GetDocuments (
  39. IEnumUnknown ** enumUnknown
  40. );
  41. HRESULT STDMETHODCALLTYPE LookupByHWND (
  42. HWND hWnd,
  43. REFIID riid,
  44. IUnknown ** ppunk
  45. );
  46. HRESULT STDMETHODCALLTYPE LookupByPoint (
  47. POINT pt,
  48. REFIID riid,
  49. IUnknown ** ppunk
  50. );
  51. HRESULT STDMETHODCALLTYPE GetFocused (
  52. REFIID riid,
  53. IUnknown ** ppunk
  54. );
  55. private:
  56. IAccStore * m_pAccStore;
  57. };
  58. #endif //__MSAACLIENTADAPTER_H_