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.

123 lines
4.5 KiB

  1. // tapiloc.h : Declaration of the CTapiLocationInfo
  2. #ifndef __TAPILOCATIONINFO_H_
  3. #define __TAPILOCATIONINFO_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CTapiLocationInfo
  7. class ATL_NO_VTABLE CTapiLocationInfo :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CTapiLocationInfo,&CLSID_TapiLocationInfo>,
  10. public CComControl<CTapiLocationInfo>,
  11. public IDispatchImpl<ITapiLocationInfo, &IID_ITapiLocationInfo, &LIBID_ICWHELPLib>,
  12. public IPersistStreamInitImpl<CTapiLocationInfo>,
  13. public IOleControlImpl<CTapiLocationInfo>,
  14. public IOleObjectImpl<CTapiLocationInfo>,
  15. public IOleInPlaceActiveObjectImpl<CTapiLocationInfo>,
  16. public IViewObjectExImpl<CTapiLocationInfo>,
  17. public IOleInPlaceObjectWindowlessImpl<CTapiLocationInfo>,
  18. public IObjectSafetyImpl<CTapiLocationInfo>
  19. {
  20. public:
  21. CTapiLocationInfo()
  22. {
  23. m_wNumTapiLocations = 0;
  24. m_dwCountry = 0;
  25. m_dwCurrLoc = 0;
  26. m_hLineApp = NULL;
  27. m_pLineCountryList = NULL;
  28. m_rgNameLookUp = NULL;
  29. m_pTC = NULL;
  30. }
  31. ~CTapiLocationInfo()
  32. {
  33. if (m_pLineCountryList)
  34. {
  35. GlobalFree(m_pLineCountryList);
  36. }
  37. if (m_rgNameLookUp)
  38. {
  39. GlobalFree(m_rgNameLookUp);
  40. }
  41. if (m_pTC)
  42. {
  43. GlobalFree(m_pTC);
  44. }
  45. }
  46. DECLARE_REGISTRY_RESOURCEID(IDR_TAPILOCATIONINFO)
  47. BEGIN_COM_MAP(CTapiLocationInfo)
  48. COM_INTERFACE_ENTRY(IDispatch)
  49. COM_INTERFACE_ENTRY(ITapiLocationInfo)
  50. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
  51. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
  52. COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
  53. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
  54. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
  55. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
  56. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
  57. COM_INTERFACE_ENTRY_IMPL(IOleControl)
  58. COM_INTERFACE_ENTRY_IMPL(IOleObject)
  59. COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
  60. COM_INTERFACE_ENTRY_IMPL(IObjectSafety)
  61. END_COM_MAP()
  62. BEGIN_PROPERTY_MAP(CTapiLocationInfo)
  63. // Example entries
  64. // PROP_ENTRY("Property Description", dispid, clsid)
  65. // PROP_PAGE(CLSID_StockColorPage)
  66. END_PROPERTY_MAP()
  67. BEGIN_MSG_MAP(CTapiLocationInfo)
  68. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  69. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  70. MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
  71. END_MSG_MAP()
  72. // IViewObjectEx
  73. STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
  74. {
  75. ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n"));
  76. *pdwStatus = 0;
  77. return S_OK;
  78. }
  79. // ITapiLocationInfo
  80. public:
  81. STDMETHOD(GetTapiLocationInfo)(/*[out, retval]*/ BOOL *pbRetVal);
  82. STDMETHOD(get_lCountryCode)(/*[out, retval]*/ long *plVal);
  83. STDMETHOD(get_NumCountries)(/*[out, retval]*/ long *pNumOfCountry);
  84. STDMETHOD(get_CountryName)(/*[in]*/ long lCountryIndex, /*[out, retval]*/ BSTR * pszCountryName, /*[out, retval]*/ long * pCountryCode);
  85. STDMETHOD(get_DefaultCountry)(/*[out, retval]*/ BSTR * pszCountryName);
  86. STDMETHOD(get_bstrAreaCode)(/*[out, retval]*/ BSTR *pbstrAreaCode);
  87. STDMETHOD(put_bstrAreaCode)(/*[in]*/ BSTR bstrAreaCode);
  88. STDMETHOD(get_wNumberOfLocations)(/*[out]*/ short *psVal, /*[out, retval]*/ long *pCurrLoc);
  89. STDMETHOD(get_LocationName)(/*[in]*/ long lLocationIndex, /*[out, retval]*/ BSTR *pszLocationName);
  90. STDMETHOD(get_LocationInfo)(/*[in]*/ long lLocationIndex, /*[out, retval]*/ long *pLocationID, /*[out, retval]*/ BSTR * pszCountryName, /*[out, retval]*/ long *pCountryCode, /*[out, retval]*/ BSTR * pszAreaCode);
  91. STDMETHOD(put_LocationId)(/*[in]*/ long lLocationID);
  92. HRESULT OnDraw(ATL_DRAWINFO& di);
  93. protected:
  94. HLINEAPP m_hLineApp;
  95. WORD m_wNumTapiLocations;
  96. DWORD m_dwCountry;
  97. DWORD m_dwCurrLoc;
  98. CComBSTR m_bstrAreaCode;
  99. CComBSTR m_bstrDefaultCountry;
  100. LPLINECOUNTRYLIST m_pLineCountryList;
  101. LPCNTRYNAMELOOKUPELEMENT m_rgNameLookUp;
  102. LPLINELOCATIONENTRY m_plle;
  103. LPLINETRANSLATECAPS m_pTC;
  104. TCHAR m_szCountryCode[8];
  105. };
  106. #endif //__TAPILOCATIONINFO_H_