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.

161 lines
4.6 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. //
  6. // SERVERR.CPP - Functions for server error page
  7. //
  8. // HISTORY:
  9. //
  10. // 06/14/98 vyung created
  11. //
  12. //*********************************************************************
  13. #include "pre.h"
  14. #include "htmlhelp.h"
  15. /*******************************************************************
  16. NAME: ServErrorInitProc
  17. SYNOPSIS: Called when page is displayed
  18. ENTRY: hDlg - dialog window
  19. fFirstInit - TRUE if this is the first time the dialog
  20. is initialized, FALSE if this InitProc has been called
  21. before (e.g. went past this page and backed up)
  22. ********************************************************************/
  23. BOOL CALLBACK ServErrorInitProc
  24. (
  25. HWND hDlg,
  26. BOOL fFirstInit,
  27. UINT *puNextPage
  28. )
  29. {
  30. BOOL bRet = TRUE;
  31. HideProgressAnimation();
  32. if (fFirstInit)
  33. {
  34. if (g_bMalformedPage)
  35. {
  36. TCHAR szMsg[MAX_MESSAGE_LEN] = TEXT("\0");
  37. LoadString(ghInstanceResDll, IDS_SERVER_ERROR_BADPAGE, szMsg, MAX_MESSAGE_LEN);
  38. SetWindowText(GetDlgItem(hDlg, IDC_SERVERR_TEXT), szMsg);
  39. g_bMalformedPage = FALSE;
  40. }
  41. else
  42. {
  43. BSTR bstrErrMsg = NULL;
  44. gpWizardState->pRefDial->get_DialErrorMsg(&bstrErrMsg);
  45. SetWindowText(GetDlgItem(hDlg, IDC_SERVERR_TEXT), W2A(bstrErrMsg));
  46. SysFreeString(bstrErrMsg);
  47. }
  48. // Fill in the support number
  49. BSTR bstrSupportPhoneNum = NULL;
  50. //Let the isp file override this in IEAK with SupportPhoneNumber=
  51. if(gpWizardState->cmnStateData.dwFlags & ICW_CFGFLAG_IEAKMODE)
  52. {
  53. gpWizardState->pRefDial->get_ISPSupportPhoneNumber(&bstrSupportPhoneNum);
  54. }
  55. if (!bstrSupportPhoneNum)
  56. gpWizardState->pRefDial->get_ISPSupportNumber(&bstrSupportPhoneNum);
  57. if (bstrSupportPhoneNum)
  58. {
  59. ASSERT(gpWizardState->lpSelectedISPInfo);
  60. gpWizardState->lpSelectedISPInfo->DisplayTextWithISPName(GetDlgItem(hDlg,IDC_SERVERR_HELP), IDS_DIALERR_HELP, W2A(bstrSupportPhoneNum));
  61. ShowWindow(GetDlgItem(hDlg, IDC_SERVERR_HELP), SW_SHOW);
  62. SysFreeString(bstrSupportPhoneNum);
  63. }
  64. else
  65. {
  66. ShowWindow(GetDlgItem(hDlg, IDC_SERVERR_HELP), SW_HIDE);
  67. }
  68. }
  69. else
  70. {
  71. KillIdleTimer();
  72. // if we've travelled through external apprentice pages,
  73. // it's easy for our current page pointer to get munged,
  74. // so reset it here for sanity's sake.
  75. gpWizardState->uCurrentPage = ORD_PAGE_SERVERR;
  76. }
  77. return bRet;
  78. }
  79. /*******************************************************************
  80. NAME: ServErrorOKProc
  81. SYNOPSIS: Called when Next or Back btns pressed from page
  82. ENTRY: hDlg - dialog window
  83. fForward - TRUE if 'Next' was pressed, FALSE if 'Back'
  84. puNextPage - if 'Next' was pressed,
  85. proc can fill this in with next page to go to. This
  86. parameter is ingored if 'Back' was pressed.
  87. pfKeepHistory - page will not be kept in history if
  88. proc fills this in with FALSE.
  89. EXIT: returns TRUE to allow page to be turned, FALSE
  90. to keep the same page.
  91. ********************************************************************/
  92. BOOL CALLBACK ServErrorOKProc
  93. (
  94. HWND hDlg,
  95. BOOL fForward,
  96. UINT *puNextPage,
  97. BOOL *pfKeepHistory
  98. )
  99. {
  100. ASSERT(puNextPage);
  101. if (fForward)
  102. {
  103. *pfKeepHistory = FALSE;
  104. gpWizardState->bDialExact = TRUE;
  105. *puNextPage = ORD_PAGE_ISPDIAL;
  106. }
  107. else
  108. {
  109. BOOL bRetVal;
  110. // Clear the dial Exact state var so that when we get to the dialing
  111. // page, we will regenerate the dial string
  112. gpWizardState->bDialExact = FALSE;
  113. gpWizardState->pRefDial->RemoveConnectoid(&bRetVal);
  114. }
  115. return TRUE;
  116. }
  117. BOOL CALLBACK ServErrorCmdProc
  118. (
  119. HWND hDlg,
  120. WPARAM wParam,
  121. LPARAM lParam
  122. )
  123. {
  124. if ((GET_WM_COMMAND_CMD (wParam, lParam) == BN_CLICKED) &&
  125. (GET_WM_COMMAND_ID (wParam, lParam) == IDC_DIAL_HELP))
  126. {
  127. HtmlHelp(NULL, ICW_HTML_HELP_TROUBLE_TOPIC, HH_DISPLAY_TOPIC, NULL);
  128. }
  129. return TRUE;
  130. }