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.

193 lines
6.0 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. //
  6. // DIALERR.CPP - Functions for final Wizard pages
  7. //
  8. // HISTORY:
  9. //
  10. // 05/28/98 donaldm created
  11. //
  12. //*********************************************************************
  13. #include "pre.h"
  14. #include "htmlhelp.h"
  15. /*******************************************************************
  16. NAME: DialErrorInitProc
  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 DialErrorInitProc
  24. (
  25. HWND hDlg,
  26. BOOL fFirstInit,
  27. UINT *puNextPage
  28. )
  29. {
  30. HideProgressAnimation();
  31. if (!fFirstInit)
  32. {
  33. KillIdleTimer();
  34. // Show the phone Number
  35. BSTR bstrPhoneNum = NULL;
  36. gpWizardState->pRefDial->get_DialPhoneNumber(&bstrPhoneNum);
  37. SetWindowText(GetDlgItem(hDlg, IDC_DIALERR_PHONENUMBER), W2A(bstrPhoneNum));
  38. SysFreeString(bstrPhoneNum);
  39. // Fill in the support number
  40. BSTR bstrSupportPhoneNum = NULL;
  41. //Let the isp file override this in IEAK with SupportPhoneNumber=
  42. if(gpWizardState->cmnStateData.dwFlags & ICW_CFGFLAG_IEAKMODE)
  43. {
  44. gpWizardState->pRefDial->get_ISPSupportPhoneNumber(&bstrSupportPhoneNum);
  45. }
  46. if (!bstrSupportPhoneNum)
  47. gpWizardState->pRefDial->get_ISPSupportNumber(&bstrSupportPhoneNum);
  48. if (bstrSupportPhoneNum)
  49. {
  50. ASSERT(gpWizardState->lpSelectedISPInfo);
  51. gpWizardState->lpSelectedISPInfo->DisplayTextWithISPName(GetDlgItem(hDlg,IDC_SERVERR_HELP), IDS_DIALERR_HELP, W2A(bstrSupportPhoneNum));
  52. ShowWindow(GetDlgItem(hDlg, IDC_SERVERR_HELP), SW_SHOW);
  53. SysFreeString(bstrSupportPhoneNum);
  54. }
  55. else
  56. {
  57. ShowWindow(GetDlgItem(hDlg, IDC_SERVERR_HELP), SW_HIDE);
  58. }
  59. // Display the error text message
  60. BSTR bstrErrMsg = NULL;
  61. gpWizardState->pRefDial->get_DialErrorMsg(&bstrErrMsg);
  62. SetWindowText(GetDlgItem(hDlg, IDC_DIALERR_TEXT), W2A(bstrErrMsg));;
  63. SysFreeString(bstrErrMsg);
  64. // if we've travelled through external apprentice pages,
  65. // it's easy for our current page pointer to get munged,
  66. // so reset it here for sanity's sake.
  67. gpWizardState->uCurrentPage = ORD_PAGE_DIALERROR;
  68. }
  69. return TRUE;
  70. }
  71. /*******************************************************************
  72. NAME: DialErrorOKProc
  73. SYNOPSIS: Called when Next or Back btns pressed from page
  74. ENTRY: hDlg - dialog window
  75. fForward - TRUE if 'Next' was pressed, FALSE if 'Back'
  76. puNextPage - if 'Next' was pressed,
  77. proc can fill this in with next page to go to. This
  78. parameter is ingored if 'Back' was pressed.
  79. pfKeepHistory - page will not be kept in history if
  80. proc fills this in with FALSE.
  81. EXIT: returns TRUE to allow page to be turned, FALSE
  82. to keep the same page.
  83. ********************************************************************/
  84. BOOL CALLBACK DialErrorOKProc
  85. (
  86. HWND hMdmCmb,
  87. BOOL fForward,
  88. UINT *puNextPage,
  89. BOOL *pfKeepHistory
  90. )
  91. {
  92. ASSERT(puNextPage);
  93. // Set the new phone Number weather the user goes forward or back
  94. TCHAR szPhone[MAX_RES_LEN];
  95. GetWindowText(GetDlgItem(hMdmCmb, IDC_DIALERR_PHONENUMBER), szPhone, ARRAYSIZE(szPhone));
  96. gpWizardState->pRefDial->put_DialPhoneNumber(A2W(szPhone));
  97. if (fForward)
  98. {
  99. // We always dial the exact number that is in the phonenumber field.
  100. gpWizardState->bDialExact = TRUE;
  101. *pfKeepHistory = FALSE;
  102. *puNextPage = ORD_PAGE_ISPDIAL;
  103. }
  104. else
  105. {
  106. BOOL bRetVal;
  107. // Clear the dial Exact state var so that when we get to the dialing
  108. // page, we will regenerate the dial string
  109. gpWizardState->bDialExact = FALSE;
  110. gpWizardState->pRefDial->RemoveConnectoid(&bRetVal);
  111. }
  112. return TRUE;
  113. }
  114. /*******************************************************************
  115. NAME: DialErrorCmdProc
  116. SYNOPSIS: Called when a command is generated from page
  117. ENTRY: hDlg - dialog window
  118. wParam - wParam
  119. lParam - lParam
  120. EXIT: returns TRUE
  121. ********************************************************************/
  122. BOOL CALLBACK DialErrorCmdProc
  123. (
  124. HWND hDlg,
  125. WPARAM wParam,
  126. LPARAM lParam
  127. )
  128. {
  129. if (GET_WM_COMMAND_CMD(wParam, lParam) == BN_CLICKED)
  130. {
  131. switch (GET_WM_COMMAND_ID(wParam, lParam))
  132. {
  133. case IDC_DIALERR_PROPERTIES:
  134. {
  135. BOOL bRetVal;
  136. gpWizardState->pRefDial->ShowDialingProperties(&bRetVal);
  137. if (bRetVal)
  138. {
  139. // Show the phone Number as it may be changed after the popup
  140. BSTR bstrPhoneNum = NULL;
  141. gpWizardState->pRefDial->get_DialPhoneNumber(&bstrPhoneNum);
  142. SetWindowText(GetDlgItem(hDlg, IDC_DIALERR_PHONENUMBER), W2A(bstrPhoneNum));
  143. SysFreeString(bstrPhoneNum);
  144. }
  145. break;
  146. }
  147. case IDC_DIAL_HELP:
  148. {
  149. HtmlHelp(NULL, ICW_HTML_HELP_TROUBLE_TOPIC, HH_DISPLAY_TOPIC, NULL);
  150. break;
  151. }
  152. default:
  153. break;
  154. }
  155. }
  156. return TRUE;
  157. }