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.

707 lines
20 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 1999
  4. Module Name:
  5. LocalFileLoggingPage1.cpp
  6. Abstract:
  7. Implementation file for the CLocalFileLoggingPage1 class.
  8. We implement the class needed to handle the first property page
  9. for the LocalFileLogging node.
  10. Author:
  11. Michael A. Maguire 12/15/97
  12. Revision History:
  13. mmaguire 12/15/97 - created
  14. --*/
  15. //////////////////////////////////////////////////////////////////////////////
  16. //////////////////////////////////////////////////////////////////////////////
  17. // BEGIN INCLUDES
  18. //
  19. // standard includes:
  20. //
  21. #include "Precompiled.h"
  22. //
  23. // where we can find declaration for main class in this file:
  24. //
  25. #include "LocalFileLoggingPage1.h"
  26. //
  27. //
  28. // where we can find declarations needed in this file:
  29. //
  30. #include "LocalFileLoggingNode.h"
  31. #include "ChangeNotification.h"
  32. //
  33. #include "LoggingMethodsNode.h"
  34. #include "LogMacNd.h"
  35. // END INCLUDES
  36. //////////////////////////////////////////////////////////////////////////////
  37. //////////////////////////////////////////////////////////////////////////////
  38. /*++
  39. CLocalFileLoggingPage1::CLocalFileLoggingPage1
  40. Constructor
  41. --*/
  42. //////////////////////////////////////////////////////////////////////////////
  43. CLocalFileLoggingPage1::CLocalFileLoggingPage1( LONG_PTR hNotificationHandle, CLocalFileLoggingNode *pLocalFileLoggingNode, TCHAR* pTitle, BOOL bOwnsNotificationHandle)
  44. : CIASPropertyPage<CLocalFileLoggingPage1> ( hNotificationHandle, pTitle, bOwnsNotificationHandle )
  45. {
  46. ATLTRACE(_T("# +++ CLocalFileLoggingPage1::CLocalFileLoggingPage1\n"));
  47. // Check for preconditions:
  48. _ASSERTE( pLocalFileLoggingNode != NULL );
  49. // Add the help button to the page
  50. // m_psp.dwFlags |= PSP_HASHELP;
  51. // Initialize the pointer to the stream into which the Sdo pointer will be marshalled.
  52. m_pStreamSdoAccountingMarshal = NULL;
  53. // Initialize the pointer to the stream into which the Sdo pointer will be marshalled.
  54. m_pStreamSdoServiceControlMarshal = NULL;
  55. // We immediately save off a parent to the client node.
  56. // We will use only the SDO, and notify the parent of the client object
  57. // we are modifying that it (and its children) may need to refresh
  58. // themselves with new data from the SDO's.
  59. m_pParentOfNodeBeingModified = pLocalFileLoggingNode->m_pParentNode;
  60. m_pNodeBeingModified = pLocalFileLoggingNode;
  61. }
  62. //////////////////////////////////////////////////////////////////////////////
  63. /*++
  64. CLocalFileLoggingPage1::~CLocalFileLoggingPage1
  65. Destructor
  66. --*/
  67. //////////////////////////////////////////////////////////////////////////////
  68. CLocalFileLoggingPage1::~CLocalFileLoggingPage1( void )
  69. {
  70. ATLTRACE(_T("# --- CLocalFileLoggingPage1::~CLocalFileLoggingPage1\n"));
  71. // Release this stream pointer if this hasn't already been done.
  72. if( m_pStreamSdoAccountingMarshal != NULL )
  73. {
  74. m_pStreamSdoAccountingMarshal->Release();
  75. };
  76. if( m_pStreamSdoServiceControlMarshal != NULL )
  77. {
  78. m_pStreamSdoServiceControlMarshal->Release();
  79. };
  80. }
  81. //////////////////////////////////////////////////////////////////////////////
  82. /*++
  83. CLocalFileLoggingPage1::OnInitDialog
  84. --*/
  85. //////////////////////////////////////////////////////////////////////////////
  86. LRESULT CLocalFileLoggingPage1::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  87. {
  88. ATLTRACE(_T("# CLocalFileLoggingPage1::OnInitDialog\n"));
  89. // Check for preconditions:
  90. _ASSERTE( m_pStreamSdoAccountingMarshal != NULL );
  91. _ASSERT( m_pSynchronizer != NULL );
  92. // Since we've been examined, we must add to the ref count of pages who need to
  93. // give their approval before they can be allowed to commit changes.
  94. m_pSynchronizer->RaiseCount();
  95. HRESULT hr;
  96. BOOL bTemp;
  97. // Unmarshall an ISdo interface pointer.
  98. // The code setting up this page should make sure that it has
  99. // marshalled the Sdo interface pointer into m_pStreamSdoAccountingMarshal.
  100. hr = CoGetInterfaceAndReleaseStream(
  101. m_pStreamSdoAccountingMarshal //Pointer to the stream from which the object is to be marshaled
  102. , IID_ISdo //Reference to the identifier of the interface
  103. , (LPVOID *) &m_spSdoAccounting //Address of output variable that receives the interface pointer requested in riid
  104. );
  105. // CoGetInterfaceAndReleaseStream releases this pointer even if it fails.
  106. // We set it to NULL so that our destructor doesn't try to release this again.
  107. m_pStreamSdoAccountingMarshal = NULL;
  108. if( FAILED( hr) || m_spSdoAccounting == NULL )
  109. {
  110. ShowErrorDialog( m_hWnd, IDS_ERROR__NO_SDO, NULL, hr, IDS_ERROR__LOGGING_TITLE );
  111. return 0;
  112. }
  113. // Unmarshall an ISdo interface pointer.
  114. // The code setting up this page should make sure that it has
  115. // marshalled the Sdo interface pointer into m_pStreamSdoServiceControlMarshal.
  116. hr = CoGetInterfaceAndReleaseStream(
  117. m_pStreamSdoServiceControlMarshal //Pointer to the stream from which the object is to be marshaled
  118. , IID_ISdoServiceControl //Reference to the identifier of the interface
  119. , (LPVOID *) &m_spSdoServiceControl //Address of output variable that receives the interface pointer requested in riid
  120. );
  121. // CoGetInterfaceAndReleaseStream releases this pointer even if it fails.
  122. // We set it to NULL so that our destructor doesn't try to release this again.
  123. m_pStreamSdoServiceControlMarshal = NULL;
  124. if( FAILED( hr) || m_spSdoServiceControl == NULL )
  125. {
  126. ShowErrorDialog( m_hWnd, IDS_ERROR__NO_SDO, NULL, hr , IDS_ERROR__LOGGING_TITLE);
  127. return 0;
  128. }
  129. // Initialize the data on the property page.
  130. // ISSUE: This is being removed from the UI -- make sure that it is removed from the SDO's as well.
  131. // hr = GetSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ENABLE, &bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_READING_ENBABLE, m_hWnd, NULL );
  132. // if( SUCCEEDED( hr ) )
  133. // {
  134. // SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__ENABLE_LOGGING, BM_SETCHECK, bTemp, 0);
  135. //
  136. // // Initialize the dirty bits;
  137. // // We do this after we've set all the data above otherwise we get false
  138. // // notifications that data has changed when we set the edit box text.
  139. // m_fDirtyEnableLogging = FALSE;
  140. // }
  141. // else
  142. // {
  143. // if( OLE_E_BLANK == hr )
  144. // {
  145. // SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__ENABLE_LOGGING, BM_SETCHECK, FALSE, 0);
  146. // m_fDirtyEnableLogging = FALSE;
  147. // SetModified( TRUE );
  148. // }
  149. // }
  150. hr = GetSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ACCOUNTING, &bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_READING_ACCOUNTING_PACKETS, m_hWnd, NULL );
  151. if( SUCCEEDED( hr ) )
  152. {
  153. SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS, BM_SETCHECK, bTemp, 0);
  154. m_fDirtyAccountingPackets = FALSE;
  155. }
  156. else
  157. {
  158. if( OLE_E_BLANK == hr )
  159. {
  160. SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS, BM_SETCHECK, FALSE, 0);
  161. m_fDirtyAccountingPackets = TRUE;
  162. SetModified( TRUE );
  163. }
  164. }
  165. hr = GetSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_AUTHENTICATION, &bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_READING_AUTHENTICATION_PACKETS, m_hWnd, NULL );
  166. if( SUCCEEDED( hr ) )
  167. {
  168. SendDlgItemMessage(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS, BM_SETCHECK, bTemp, 0);
  169. m_fDirtyAuthenticationPackets = FALSE;
  170. }
  171. else
  172. {
  173. if( OLE_E_BLANK == hr )
  174. {
  175. SendDlgItemMessage(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS, BM_SETCHECK, FALSE, 0);
  176. m_fDirtyAuthenticationPackets = TRUE;
  177. SetModified( TRUE );
  178. }
  179. }
  180. hr = GetSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ACCOUNTING_INTERIM, &bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_READING_INTERIM_ACCOUNTING_PACKETS, m_hWnd, NULL );
  181. if( SUCCEEDED( hr ) )
  182. {
  183. SendDlgItemMessage(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS, BM_SETCHECK, bTemp, 0);
  184. m_fDirtyInterimAccounting = FALSE;
  185. }
  186. else
  187. {
  188. if( OLE_E_BLANK == hr )
  189. {
  190. SendDlgItemMessage(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS, BM_SETCHECK, FALSE, 0);
  191. m_fDirtyInterimAccounting = TRUE;
  192. SetModified( TRUE );
  193. }
  194. }
  195. // Manages some UI dependencies when certain buttons aren't checked.
  196. SetEnableLoggingDependencies();
  197. return TRUE; // ISSUE: what do we need to be returning here?
  198. }
  199. //////////////////////////////////////////////////////////////////////////////
  200. /*++
  201. CLocalFileLoggingPage1::OnChange
  202. Called when the WM_COMMAND message is sent to our page with any of the
  203. BN_CLICKED, EN_CHANGE or CBN_SELCHANGE notifications.
  204. This is our chance to check to see what the user has touched, set the
  205. dirty bits for these items so that only they will be saved,
  206. and enable the Apply button.
  207. --*/
  208. //////////////////////////////////////////////////////////////////////////////
  209. LRESULT CLocalFileLoggingPage1::OnChange(
  210. UINT uMsg
  211. , WPARAM wParam
  212. , HWND hwnd
  213. , BOOL& bHandled
  214. )
  215. {
  216. ATLTRACE(_T("# CLocalFileLoggingPage1::OnChange\n"));
  217. // Check for preconditions:
  218. // None.
  219. // We don't want to prevent anyone else down the chain from receiving a message.
  220. bHandled = FALSE;
  221. // Figure out which item has changed and set the dirty bit for that item.
  222. int iItemID = (int) LOWORD(wParam);
  223. switch( iItemID )
  224. {
  225. // case IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__ENABLE_LOGGING:
  226. // m_fDirtyEnableLogging = TRUE;
  227. // break;
  228. case IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS:
  229. m_fDirtyAccountingPackets = TRUE;
  230. break;
  231. case IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS:
  232. m_fDirtyAuthenticationPackets = TRUE;
  233. break;
  234. case IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS:
  235. m_fDirtyInterimAccounting = TRUE;
  236. break;
  237. default:
  238. return TRUE;
  239. break;
  240. }
  241. // We should only get here if the item that changed was
  242. // one of the ones we were checking for.
  243. // This enables the Apply button.
  244. SetModified( TRUE );
  245. return TRUE; // ISSUE: what do we need to be returning here?
  246. }
  247. //////////////////////////////////////////////////////////////////////////////
  248. /*++
  249. CLocalFileLoggingPage1::OnApply
  250. Return values:
  251. TRUE if the page can be destroyed,
  252. FALSE if the page should not be destroyed (i.e. there was invalid data)
  253. Remarks:
  254. OnApply gets called for each page in on a property sheet if that
  255. page has been visited, regardless of whether any values were changed.
  256. If you never switch to a tab, then its OnApply method will never get called.
  257. --*/
  258. //////////////////////////////////////////////////////////////////////////////
  259. BOOL CLocalFileLoggingPage1::OnApply()
  260. {
  261. ATLTRACE(_T("# CLocalFileLoggingPage1::OnApply\n"));
  262. // Check for preconditions:
  263. _ASSERT( m_pSynchronizer != NULL );
  264. if( m_spSdoAccounting == NULL )
  265. {
  266. ShowErrorDialog( m_hWnd, IDS_ERROR__NO_SDO , NULL, 0, IDS_ERROR__LOGGING_TITLE);
  267. return FALSE;
  268. }
  269. HRESULT hr;
  270. BOOL bTemp;
  271. // ISSUE: We are removing this from the UI -- make sure to remove it from the SDO's and accounting handler as well.
  272. // if( m_fDirtyEnableLogging )
  273. // {
  274. // bTemp = SendDlgItemMessage(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__ENABLE_LOGGING, BM_GETCHECK, 0, 0);
  275. //
  276. // bTemp = TRUE;
  277. // hr = PutSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ENABLE, bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_WRITING_ENABLE, m_hWnd, NULL );
  278. // if( FAILED( hr ) )
  279. // {
  280. // // Reset the ref count so all pages know that we need to play the game again.
  281. // m_pSynchronizer->ResetCountToHighest();
  282. //
  283. // // This uses the resource ID of this page to make this page the current page.
  284. // PropSheet_SetCurSelByID( GetParent(), IDD );
  285. //
  286. // return FALSE;
  287. // }
  288. // else
  289. // {
  290. // // We succeeded.
  291. //
  292. // // Turn off the dirty bit.
  293. // m_fDirtyEnableLogging = FALSE;
  294. // }
  295. // }
  296. if( m_fDirtyAccountingPackets )
  297. {
  298. bTemp = SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS, BM_GETCHECK, 0, 0);
  299. hr = PutSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ACCOUNTING, bTemp, IDS_ERROR__LOCAL_FILE_LOGGING_WRITING_ACCOUNTING_PACKETS, m_hWnd, NULL );
  300. if( FAILED( hr ) )
  301. {
  302. // Reset the ref count so all pages know that we need to play the game again.
  303. m_pSynchronizer->ResetCountToHighest();
  304. // This uses the resource ID of this page to make this page the current page.
  305. PropSheet_SetCurSelByID( GetParent(), IDD );
  306. return FALSE;
  307. }
  308. else
  309. {
  310. // We succeeded.
  311. // Turn off the dirty bit.
  312. m_fDirtyAccountingPackets = FALSE;
  313. }
  314. }
  315. if( m_fDirtyAuthenticationPackets )
  316. {
  317. bTemp = SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS, BM_GETCHECK, 0, 0);
  318. hr = PutSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_AUTHENTICATION, bTemp, IDS_ERROR__CANT_WRITE_DATA_TO_SDO, m_hWnd, NULL );
  319. if( FAILED( hr ) )
  320. {
  321. // Reset the ref count so all pages know that we need to play the game again.
  322. m_pSynchronizer->ResetCountToHighest();
  323. // This uses the resource ID of this page to make this page the current page.
  324. PropSheet_SetCurSelByID( GetParent(), IDD );
  325. return FALSE;
  326. }
  327. else
  328. {
  329. // We succeeded.
  330. // Turn off the dirty bit.
  331. m_fDirtyAuthenticationPackets = FALSE;
  332. }
  333. }
  334. if( m_fDirtyInterimAccounting )
  335. {
  336. bTemp = SendDlgItemMessage( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS, BM_GETCHECK, 0, 0);
  337. hr = PutSdoBOOL( m_spSdoAccounting, PROPERTY_ACCOUNTING_LOG_ACCOUNTING_INTERIM, bTemp, IDS_ERROR__CANT_WRITE_DATA_TO_SDO, m_hWnd, NULL );
  338. if( FAILED( hr ) )
  339. {
  340. // Reset the ref count so all pages know that we need to play the game again.
  341. m_pSynchronizer->ResetCountToHighest();
  342. // This uses the resource ID of this page to make this page the current page.
  343. PropSheet_SetCurSelByID( GetParent(), IDD );
  344. return FALSE;
  345. }
  346. else
  347. {
  348. // We succeeded.
  349. // Turn off the dirty bit.
  350. m_fDirtyInterimAccounting = FALSE;
  351. }
  352. }
  353. // If we made it to here, try to apply the changes.
  354. // Check to see if there are other pages which have not yet validated their data.
  355. LONG lRefCount = m_pSynchronizer->LowerCount();
  356. if( lRefCount <= 0 )
  357. {
  358. // There is nobody else left, so now we can commit the data.
  359. hr = m_spSdoAccounting->Apply();
  360. if( FAILED( hr ) )
  361. {
  362. if(hr == DB_E_NOTABLE) // assume, the RPC connection has problem
  363. ShowErrorDialog( m_hWnd, IDS_ERROR__NOTABLE_TO_WRITE_SDO, NULL, 0, IDS_ERROR__LOGGING_TITLE );
  364. else
  365. {
  366. ShowErrorDialog( m_hWnd, IDS_ERROR__CANT_WRITE_DATA_TO_SDO, NULL, 0, IDS_ERROR__LOGGING_TITLE );
  367. }
  368. // Reset the ref count so all pages know that we need to play the game again.
  369. m_pSynchronizer->ResetCountToHighest();
  370. // This uses the resource ID of this page to make this page the current page.
  371. PropSheet_SetCurSelByID( GetParent(), IDD );
  372. return FALSE;
  373. }
  374. else
  375. {
  376. // We succeeded.
  377. // The data was accepted, so notify the main context of our snapin
  378. // that it may need to update its views.
  379. CChangeNotification * pChangeNotification = new CChangeNotification();
  380. pChangeNotification->m_dwFlags = CHANGE_UPDATE_RESULT_NODE;
  381. pChangeNotification->m_pNode = m_pNodeBeingModified;
  382. pChangeNotification->m_pParentNode = m_pParentOfNodeBeingModified;
  383. HRESULT hr = PropertyChangeNotify( (LPARAM) pChangeNotification );
  384. _ASSERTE( SUCCEEDED( hr ) );
  385. // Tell the service to reload data.
  386. HRESULT hrTemp = m_spSdoServiceControl->ResetService();
  387. if( FAILED( hrTemp ) )
  388. {
  389. // Fail silently.
  390. }
  391. }
  392. }
  393. return TRUE;
  394. }
  395. //////////////////////////////////////////////////////////////////////////////
  396. /*++
  397. CLocalFileLoggingPage1::OnQueryCancel
  398. Return values:
  399. TRUE if the page can be destroyed,
  400. FALSE if the page should not be destroyed (i.e. there was invalid data)
  401. Remarks:
  402. OnQueryCancel gets called for each page in on a property sheet if that
  403. page has been visited, regardless of whether any values were changed.
  404. If you never switch to a tab, then its OnQueryCancel method will never get called.
  405. --*/
  406. //////////////////////////////////////////////////////////////////////////////
  407. BOOL CLocalFileLoggingPage1::OnQueryCancel()
  408. {
  409. ATLTRACE(_T("# CLocalFileLoggingPage1::OnQueryCancel\n"));
  410. HRESULT hr;
  411. if( m_spSdoAccounting != NULL )
  412. {
  413. // If the user wants to cancel, we should make sure that we rollback
  414. // any changes the user may have started.
  415. // If the user had not already tried to commit something,
  416. // a cancel on an SDO will hopefully be designed to be benign.
  417. hr = m_spSdoAccounting->Restore();
  418. // Don't care about the HRESULT, but it might be good to see it for debugging.
  419. }
  420. return TRUE;
  421. }
  422. //////////////////////////////////////////////////////////////////////////////
  423. /*++
  424. CLocalFileLoggingPage1::OnEnableLogging
  425. Remarks:
  426. Called when the user clicks on the Enable Logging check box.
  427. --*/
  428. //////////////////////////////////////////////////////////////////////////////
  429. LRESULT CLocalFileLoggingPage1::OnEnableLogging(
  430. UINT uMsg
  431. , WPARAM wParam
  432. , HWND hwnd
  433. , BOOL& bHandled
  434. )
  435. {
  436. ATLTRACE(_T("# CLocalFileLoggingPage1::OnEnableLogging\n"));
  437. // The Enable Logging button has been checked -- check dependencies.
  438. SetEnableLoggingDependencies();
  439. // This return value is ignored.
  440. return TRUE;
  441. }
  442. //////////////////////////////////////////////////////////////////////////////
  443. /*++
  444. CLocalFileLoggingPage1::SetEnableLoggingDependencies
  445. Remarks:
  446. Utility to set state of items which may depend on the
  447. Enable Logging check box.
  448. --*/
  449. //////////////////////////////////////////////////////////////////////////////
  450. void CLocalFileLoggingPage1::SetEnableLoggingDependencies( void )
  451. {
  452. ATLTRACE(_T("# CLocalFileLoggingPage1::SetEnableLoggingDependencies\n"));
  453. // disable some content when extending RRAS
  454. // We need access here to some server-global data.
  455. _ASSERTE( m_pParentOfNodeBeingModified != NULL );
  456. CLoggingMachineNode * pServerNode = ((CLoggingMethodsNode *) m_pParentOfNodeBeingModified)->GetServerRoot();
  457. BOOL bNTAcc = TRUE;
  458. BOOL bNTAuth = TRUE;
  459. _ASSERTE( pServerNode != NULL );
  460. if(pServerNode->m_enumExtendedSnapin == RRAS_SNAPIN)
  461. {
  462. BSTR bstrMachine = NULL;
  463. if(!pServerNode->m_bConfigureLocal)
  464. bstrMachine = pServerNode->m_bstrServerAddress;
  465. bNTAcc = IsRRASUsingNTAccounting(bstrMachine);
  466. bNTAuth = IsRRASUsingNTAuthentication(bstrMachine);
  467. }
  468. // We are getting rid of the ENABLE_LOGGING button.
  469. // // Ascertain what the state of the check box is.
  470. // int iChecked = ::SendMessage( GetDlgItem(IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__ENABLE_LOGGING), BM_GETCHECK, 0, 0 );
  471. //
  472. // if( iChecked )
  473. // {
  474. // // Make sure the correct items are enabled.
  475. ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS), bNTAcc );
  476. ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS), bNTAuth );
  477. ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS), bNTAcc);
  478. // }
  479. // else
  480. // {
  481. // // Make sure the correct items are enabled.
  482. // ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_ACCOUNTING_PACKETS), FALSE );
  483. // ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_AUTHENTICATION_PACKETS), FALSE );
  484. // ::EnableWindow( GetDlgItem( IDC_CHECK_LOCAL_FILE_LOGING_PAGE1__LOG_INTERIM_ACCOUNTING_PACKETS), FALSE );
  485. // }
  486. }
  487. /////////////////////////////////////////////////////////////////////////////
  488. /*++
  489. CLocalFileLoggingPage1::GetHelpPath
  490. Remarks:
  491. This method is called to get the help file path within
  492. an compressed HTML document when the user presses on the Help
  493. button of a property sheet.
  494. It is an override of atlsnap.h CIASPropertyPageImpl::OnGetHelpPath.
  495. --*/
  496. //////////////////////////////////////////////////////////////////////////////
  497. HRESULT CLocalFileLoggingPage1::GetHelpPath( LPTSTR szHelpPath )
  498. {
  499. ATLTRACE(_T("# CLocalFileLoggingPage1::GetHelpPath\n"));
  500. // Check for preconditions:
  501. #ifdef UNICODE_HHCTRL
  502. // ISSUE: We seemed to have a problem with passing WCHAR's to the hhctrl.ocx
  503. // installed on this machine -- it appears to be non-unicode.
  504. lstrcpy( szHelpPath, _T("idh_proppage_local_file_logging1.htm") );
  505. #else
  506. strcpy( (CHAR *) szHelpPath, "idh_proppage_local_file_logging1.htm" );
  507. #endif
  508. return S_OK;
  509. }