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.

119 lines
3.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class DatabasePage.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef DBPAGE_H
  11. #define DBPAGE_H
  12. #pragma once
  13. #include "msdasc.h"
  14. #include "propertypage.h"
  15. class DatabaseNode;
  16. // The lone property page for the database node.
  17. class DatabasePage : public CIASPropertyPage<DatabasePage>
  18. {
  19. public:
  20. DatabasePage(
  21. LONG_PTR notifyHandle,
  22. wchar_t* title,
  23. DatabaseNode* newSrc
  24. );
  25. ~DatabasePage() throw ();
  26. // Used to initialize the page immediately after constructor. This is useful
  27. // because the constructor can't return an error code.
  28. HRESULT Initialize(
  29. ISdo* config,
  30. ISdoServiceControl* control
  31. ) throw ();
  32. BOOL OnApply() throw ();
  33. static const unsigned int IDD = IDD_DB_PROPPAGE;
  34. private:
  35. // Invokes the DataLinks UI to configure the database connection.
  36. HRESULT ConfigureConnection() throw ();
  37. // Load a bool from an SDO property and put it in a control
  38. void LoadBool(UINT control, LONG propId) throw ();
  39. // Get a bool from a control and save it in an SDO property.
  40. void SaveBool(UINT control, LONG propId) throw ();
  41. LRESULT OnInitDialog(
  42. UINT uMsg,
  43. WPARAM wParam,
  44. LPARAM lParam,
  45. BOOL& bHandled
  46. );
  47. LRESULT OnChange(
  48. WORD wNotifyCode,
  49. WORD wID,
  50. HWND hWndCtl,
  51. BOOL& bHandled
  52. );
  53. LRESULT OnClear(
  54. WORD wNotifyCode,
  55. WORD wID,
  56. HWND hWndCtl,
  57. BOOL& bHandled
  58. );
  59. LRESULT OnConfigure(
  60. WORD wNotifyCode,
  61. WORD wID,
  62. HWND hWndCtl,
  63. BOOL& bHandled
  64. );
  65. BEGIN_MSG_MAP(DatabasePage)
  66. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  67. COMMAND_HANDLER(IDC_DB_CHECK_ACCT, BN_CLICKED, OnChange)
  68. COMMAND_HANDLER(IDC_DB_CHECK_AUTH, BN_CLICKED, OnChange)
  69. COMMAND_HANDLER(IDC_DB_CHECK_INTERIM, BN_CLICKED, OnChange)
  70. COMMAND_HANDLER(IDC_DB_BUTTON_CONFIGURE, BN_CLICKED, OnConfigure)
  71. COMMAND_HANDLER(IDC_DB_BUTTON_CLEAR, BN_CLICKED, OnClear)
  72. COMMAND_HANDLER(IDC_DB_EDIT_MAX_SESSIONS, EN_CHANGE, OnChange)
  73. CHAIN_MSG_MAP(CIASPropertyPage<DatabasePage>)
  74. END_MSG_MAP()
  75. // The source of our data.
  76. DatabaseNode* src;
  77. // Streamed version of SDO containing our configuration.
  78. CComPtr<IStream> configStream;
  79. // Streamed version of SDO used for resetting the service.
  80. CComPtr<IStream> controlStream;
  81. // Unstreamed version of SDO containing our configuration.
  82. CComPtr<ISdo> configSdo;
  83. // Unstreamed version of SDO used for resetting the service.
  84. CComPtr<ISdoServiceControl> controlSdo;
  85. // Current initialization string (may be null)
  86. LPOLESTR initString;
  87. // Current data source name (may be null)
  88. CComBSTR dataSourceName;
  89. // Various OLE-DB objects; these are created JIT.
  90. CComPtr<IDataInitialize> dataInitialize;
  91. CComPtr<IDBPromptInitialize> dataLinks;
  92. CComPtr<IDBProperties> dataSource;
  93. // True if our database config is dirty.
  94. bool dbConfigDirty;
  95. // True if our SDO config is dirty.
  96. bool sdoConfigDirty;
  97. // Not implemented.
  98. DatabasePage(const DatabasePage&);
  99. DatabasePage& operator=(const DatabasePage&);
  100. };
  101. #endif // DBPAGE_H