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.

90 lines
2.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class Resolver and its subclasses.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef RESOLVER_H
  11. #define RESOLVER_H
  12. #pragma once
  13. #include "dlgcshlp.h"
  14. ///////////////////////////////////////////////////////////////////////////////
  15. //
  16. // CLASS
  17. //
  18. // Resolver
  19. //
  20. // DESCRIPTION
  21. //
  22. // Base class for a simple DNS name resolution dialog. This is specialized
  23. // for client and server addresses.
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. class Resolver : public CHelpDialog
  27. {
  28. public:
  29. Resolver(UINT dialog, PCWSTR dnsName, CWnd* pParent = NULL);
  30. ~Resolver() throw ();
  31. PCWSTR getChoice() const throw ()
  32. { return choice; }
  33. protected:
  34. // Defined in the derived class to display an error dialog if a name
  35. // couldn't be resolved.
  36. virtual void OnResolveError() = 0;
  37. // Overridden in the defined class to determine if a name is already an
  38. // address. If this function returns true, the name will be presented to the
  39. // user 'as is'.
  40. virtual BOOL IsAddress(PCWSTR sz) const throw ();
  41. virtual BOOL OnInitDialog();
  42. virtual void DoDataExchange(CDataExchange* pDX);
  43. afx_msg void OnResolve();
  44. DECLARE_MESSAGE_MAP()
  45. // Set (or reset) style flags associated with a button control.
  46. void setButtonStyle(int controlId, long flags, bool set = true);
  47. // Set the focus to a control on the page.
  48. void setFocusControl(int controlId);
  49. private:
  50. CString name;
  51. CString choice;
  52. CListCtrl results;
  53. // Not implemented.
  54. Resolver(const Resolver&);
  55. Resolver& operator=(const Resolver&);
  56. };
  57. class ServerResolver : public Resolver
  58. {
  59. public:
  60. ServerResolver(PCWSTR dnsName, CWnd* pParent = NULL);
  61. private:
  62. virtual void OnResolveError();
  63. };
  64. class ClientResolver : public Resolver
  65. {
  66. public:
  67. ClientResolver(PCWSTR dnsName, CWnd* pParent = NULL);
  68. private:
  69. virtual void OnResolveError();
  70. virtual BOOL IsAddress(PCWSTR sz) const throw ();
  71. };
  72. #endif // RESOLVER_H