home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / tstcon / tstcon.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  16.2 KB  |  627 lines

  1. // TestContainer98.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "StdAfx.H"
  5. #include "TestCon.H"
  6.  
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13. CTCOptions::CTCOptions() :
  14.    m_iLogType( TCLOG_OUTPUTWINDOW ),
  15.    m_tUserMode( FALSE ),
  16.    m_tAllowWindowless( TRUE ),
  17.    m_tQuickActivation( TRUE ),
  18.    m_tTwoPassDrawing( TRUE ),
  19.    m_tUseIPointerInactive( TRUE ),
  20.    m_tHonorIgnoreActivateWhenVisible( TRUE ),
  21.    m_tIOleInPlaceSiteEx( TRUE ),
  22.    m_tIOleInPlaceSiteWindowless( TRUE ),
  23.    m_tIAdviseSinkEx( TRUE ),
  24.    m_tSBindHost( TRUE )
  25. {
  26. }
  27.  
  28. CTCCommandLineInfo::CTCCommandLineInfo( CTCOptions* pOptions ) :
  29.    m_pOptions( pOptions ),
  30.    m_tExpectingLogFileName( FALSE ),
  31.    m_tExpectingProgID( FALSE )
  32. {
  33.    ASSERT( m_pOptions != NULL );
  34. }
  35.  
  36. /*
  37.    TestContainer98 command line switches:
  38.  
  39.    -C <progid>    ProgID of control to initially load
  40.  
  41.    -Ln            No logging
  42.    -Lo            Log to output window
  43.    -Ld            Log to debugger
  44.    -Lf <filename> Log to file <filename>
  45.  
  46.    -IOleInPlaceSiteEx+  Support IOleInPlaceSiteEx
  47.    -IOleInPlaceSiteEx-  Don't support IOleInPlaceSiteEx
  48.  
  49.    -IOleInPlaceSiteWindowless+ Support IOleInPlaceSiteWindowless
  50.    -IOleInPlaceSiteWindowless- Don't support IOleInPlaceSiteWindowless
  51.  
  52.    -IAdviseSinkEx+   Support IAdviseSinkEx
  53.    -IAdviseSinkEx-   Don't support IAdviseSinkEx
  54.  
  55.    -SBindHost+    Support SBindHost
  56.    -SBindHost-    Don't support SBindHost
  57.  
  58.    -OQ+           Use quick activation
  59.    -OQ-           Do not use quick activation
  60.  
  61.    -OT+           Use two-pass drawing
  62.    -OT-           Do not use two-pass drawing
  63.  
  64.    -OI+           Support inactive controls
  65.    -OI-           Do not support inactive controls
  66.  
  67.    -OH+           Honor OLEMISC_IGNOREACTIVATEWHENVISIBLE
  68.    -OH-           Don't honor OLEMISC_IGNOREACTIVATEWHENVISIBLE
  69.  
  70.    -OW+           Allow windowless activation
  71.    -OW-           Disallow windowless activation
  72.  
  73.    -U+            User mode
  74.    -U-            Design mode
  75. */
  76.  
  77. void CTCCommandLineInfo::ParseServiceFlag( LPCTSTR pszParam )
  78. {
  79.    BOOL* ptService;
  80.    const TCHAR* pcFlag;
  81.  
  82.    ASSERT( pszParam != NULL );
  83.    ASSERT( pszParam[0] == 'S' );
  84.  
  85.    ptService = NULL;
  86.    pcFlag = NULL;
  87.    if( strncmp( pszParam, _T( "SBindHost" ), strlen( _T( "SBindHost" ) ) ) ==
  88.       0 )
  89.    {
  90.       ptService = &m_pOptions->m_tSBindHost;
  91.       pcFlag = &pszParam[strlen( _T( "SBindHost" ) )];
  92.    }
  93.  
  94.    if( ptService == NULL )
  95.    {
  96.       TCTrace( TRACELEVEL_NORMAL, "Unrecognized command line parameter %s\n",
  97.          pszParam );
  98.    }
  99.    else
  100.    {
  101.       if( *pcFlag == _T( '+' ) )
  102.       {
  103.          *ptService = TRUE;
  104.       }
  105.       else if( *pcFlag == _T( '-' ) )
  106.       {
  107.          *ptService = FALSE;
  108.       }
  109.       else
  110.       {
  111.          TCTrace( TRACELEVEL_NORMAL,
  112.             "Command line option %s: Expected + or -\n", pszParam );
  113.       }
  114.    }
  115. }
  116.  
  117. void CTCCommandLineInfo::ParseInterfaceFlag( LPCTSTR pszParam )
  118. {
  119.    ASSERT( pszParam != NULL );
  120.    ASSERT( pszParam[0] == 'I' );
  121.  
  122.    if( strncmp( pszParam, _T( "IOleInPlaceSiteEx" ), strlen( _T(
  123.       "IOleInPlaceSiteEx" ) ) ) == 0 )
  124.    {
  125.       switch( pszParam[strlen( _T( "IOleInPlaceSiteEx" ) )] )
  126.       {
  127.       case _T( '+' ):
  128.          m_pOptions->m_tIOleInPlaceSiteEx = TRUE;
  129.          break;
  130.  
  131.       case _T( '-' ):
  132.          m_pOptions->m_tIOleInPlaceSiteEx = FALSE;
  133.          break;
  134.  
  135.       default:
  136.          TCTrace( 1, "Unrecognized command line parameter %s\n", pszParam );
  137.          break;
  138.       }
  139.    }
  140.    else if( strncmp( pszParam, _T( "IOleInPlaceSiteWindowless" ), strlen( _T(
  141.       "IOleInPlaceSiteWindowless" ) ) ) == 0 )
  142.    {
  143.       switch( pszParam[strlen( _T( "IOleInPlaceSiteWindowless" ) )] )
  144.       {
  145.       case _T( '+' ):
  146.          m_pOptions->m_tIOleInPlaceSiteWindowless = TRUE;
  147.          break;
  148.  
  149.       case _T( '-' ):
  150.          m_pOptions->m_tIOleInPlaceSiteWindowless = FALSE;
  151.          break;
  152.  
  153.       default:
  154.          TCTrace( 1, "Unrecognized command line parameter %s\n", pszParam );
  155.          break;
  156.       }
  157.    }
  158.    else if( strncmp( pszParam, _T( "IAdviseSinkEx" ), strlen( _T(
  159.       "IAdviseSinkEx" ) ) ) == 0 )
  160.    {
  161.       switch( pszParam[strlen( _T( "IAdviseSinkEx" ) )] )
  162.       {
  163.       case _T( '+' ):
  164.          m_pOptions->m_tIAdviseSinkEx = TRUE;
  165.          break;
  166.  
  167.       case _T( '-' ):
  168.          m_pOptions->m_tIAdviseSinkEx = FALSE;
  169.          break;
  170.  
  171.       default:
  172.          TCTrace( 1, "Unrecognized command line parameter %s\n", pszParam );
  173.          break;
  174.       }
  175.    }
  176.    else
  177.    {
  178.       TCTrace( 1, "Unrecognized command line parameter %s\n", pszParam );
  179.    }
  180. }
  181.  
  182. void CTCCommandLineInfo::ParseOptionFlag( LPCTSTR pszParam )
  183. {
  184.    BOOL* ptOption;
  185.  
  186.    ASSERT( pszParam != NULL );
  187.    ASSERT( pszParam[0] == 'O' );
  188.  
  189.    ptOption = NULL;
  190.    switch( pszParam[1] )
  191.    {
  192.    case _T( 'Q' ):
  193.       ptOption = &m_pOptions->m_tQuickActivation;
  194.       break;
  195.  
  196.    case _T( 'T' ):
  197.       ptOption = &m_pOptions->m_tTwoPassDrawing;
  198.       break;
  199.  
  200.    case _T( 'W' ):
  201.       ptOption = &m_pOptions->m_tAllowWindowless;
  202.       break;
  203.  
  204.    case _T( 'H' ):
  205.       ptOption = &m_pOptions->m_tHonorIgnoreActivateWhenVisible;
  206.       break;
  207.  
  208.    case _T( 'I' ):
  209.       ptOption = &m_pOptions->m_tUseIPointerInactive;
  210.       break;
  211.  
  212.    default:
  213.       TCTrace( 1, "Unrecognized command line parameter %s\n", pszParam );
  214.       break;
  215.    }
  216.  
  217.    if( ptOption != NULL )
  218.    {
  219.       if( pszParam[2] == _T( '+' ) )
  220.       {
  221.          *ptOption = TRUE;
  222.       }
  223.       else if( pszParam[2] == _T( '-' ) )
  224.       {
  225.          *ptOption = FALSE;
  226.       }
  227.       else
  228.       {
  229.          TCTrace( TRACELEVEL_NORMAL,
  230.             "Command line option %s: expected + or -\n", pszParam );
  231.       }
  232.    }
  233. }
  234.  
  235. void CTCCommandLineInfo::ParseParam( LPCTSTR pszParam, BOOL tFlag, BOOL tLast )
  236. {
  237.    BOOL tHandled;
  238.  
  239.    TRACE( "%s\n", pszParam );
  240.  
  241.    tHandled = FALSE;
  242.  
  243.    if( m_tExpectingLogFileName )
  244.    {
  245.       tHandled = TRUE;
  246.       m_tExpectingLogFileName = FALSE;
  247.       if( tFlag )
  248.       {
  249.          TCTrace( TRACELEVEL_NORMAL, "Bogus log filename\n" );
  250.       }
  251.       else
  252.       {
  253.          m_pOptions->m_strLogFileName = pszParam;
  254.       }
  255.    }
  256.    else if( m_tExpectingProgID )
  257.    {
  258.       tHandled = TRUE;
  259.       m_tExpectingProgID = FALSE;
  260.       if( tFlag )
  261.       {
  262.          TCTrace( TRACELEVEL_NORMAL, "Bogus ProgID\n" );
  263.       }
  264.       else
  265.       {
  266.          m_pOptions->m_strProgID = pszParam;
  267.       }
  268.    }
  269.    else
  270.    {
  271.       if( tFlag )
  272.       {
  273.          tHandled = TRUE;
  274.          switch( pszParam[0] )
  275.          {
  276.          case _T( 'C' ):
  277.             if( tLast )
  278.             {
  279.                TCTrace( TRACELEVEL_NORMAL,
  280.                   "No ProgID given for /C parameter\n" );
  281.             }
  282.             else
  283.             {
  284.                m_tExpectingProgID = TRUE;
  285.             }
  286.             break;
  287.  
  288.          case _T( 'I' ):
  289.             ParseInterfaceFlag( pszParam );
  290.             break;
  291.  
  292.          case _T( 'S' ):
  293.             ParseServiceFlag( pszParam );
  294.             break;
  295.  
  296.          case _T( 'L' ):
  297.             switch( pszParam[1] )
  298.             {
  299.             case _T( 'n' ):
  300.                m_pOptions->m_iLogType = TCLOG_NULL;
  301.                break;
  302.  
  303.             case _T( 'o' ):
  304.                m_pOptions->m_iLogType = TCLOG_OUTPUTWINDOW;
  305.                break;
  306.  
  307.             case _T( 'd' ):
  308.                m_pOptions->m_iLogType = TCLOG_DEBUG;
  309.                break;
  310.  
  311.             case _T( 'f' ):
  312.                if( tLast )
  313.                {
  314.                   TCTrace( 1, "No filename given for /Lf parameter\n" );
  315.                }
  316.                else
  317.                {
  318.                   m_tExpectingLogFileName = TRUE;
  319.                }
  320.                break;
  321.  
  322.             default:
  323.                TCTrace( 1, "Unrecognized command line parameter %s\n",
  324.                   pszParam );
  325.                break;
  326.             }
  327.             break;
  328.  
  329.          case _T( 'O' ):
  330.             ParseOptionFlag( pszParam );
  331.             break;
  332.  
  333.          case _T( 'U' ):
  334.             switch( pszParam[1] )
  335.             {
  336.             case _T( '-' ):
  337.                m_pOptions->m_tUserMode = FALSE;
  338.                break;
  339.  
  340.             case _T( '+' ):
  341.                m_pOptions->m_tUserMode = TRUE;
  342.                break;
  343.  
  344.             default:
  345.                TCTrace( 1, "Unrecognized command line parameter %s\n",
  346.                   pszParam );
  347.                break;
  348.             }
  349.             break;
  350.  
  351.          default:
  352.             tHandled = FALSE;
  353.             break;
  354.          }
  355.       }
  356.    }
  357.  
  358.    if( !tHandled )
  359.    {
  360.       CCommandLineInfo::ParseParam( pszParam, tFlag, tLast );
  361.    }
  362. }
  363.  
  364. /////////////////////////////////////////////////////////////////////////////
  365. // CTestContainer98App
  366.  
  367. BEGIN_MESSAGE_MAP(CTestContainer98App, CWinApp)
  368.     //{{AFX_MSG_MAP(CTestContainer98App)
  369.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  370.     ON_COMMAND(ID_OPTIONS_TRACELEVEL_NONE, OnOptionsTraceLevelNone)
  371.     ON_COMMAND(ID_OPTIONS_TRACELEVEL_NORMAL, OnOptionsTraceLevelNormal)
  372.     ON_COMMAND(ID_OPTIONS_TRACELEVEL_VERBOSE, OnOptionsTraceLevelVerbose)
  373.     ON_UPDATE_COMMAND_UI(ID_OPTIONS_TRACELEVEL_NONE, OnUpdateOptionsTraceLevelNone)
  374.     ON_UPDATE_COMMAND_UI(ID_OPTIONS_TRACELEVEL_NORMAL, OnUpdateOptionsTraceLevelNormal)
  375.     ON_UPDATE_COMMAND_UI(ID_OPTIONS_TRACELEVEL_VERBOSE, OnUpdateOptionsTraceLevelVerbose)
  376.     ON_COMMAND(ID_FILE_REGISTERCONTROLS, OnFileRegisterControls)
  377.     //}}AFX_MSG_MAP
  378.     // Standard file based document commands
  379.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  380.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  381. END_MESSAGE_MAP()
  382.  
  383. /////////////////////////////////////////////////////////////////////////////
  384. // CTestContainer98App construction
  385.  
  386. CTestContainer98App::CTestContainer98App()
  387. {
  388.     // TODO: add construction code here,
  389.     // Place all significant initialization in InitInstance
  390. }
  391.  
  392. /////////////////////////////////////////////////////////////////////////////
  393. // The one and only CTestContainer98App object
  394.  
  395. CTestContainer98App theApp;
  396.  
  397. // This identifier was generated to be statistically unique for your app.
  398. // You may change it if you prefer to choose a specific identifier.
  399.  
  400. // {198184FA-B837-11D0-8DF1-00C04FB68D60}
  401. static const CLSID clsid =
  402. { 0x198184fa, 0xb837, 0x11d0, { 0x8d, 0xf1, 0x0, 0xc0, 0x4f, 0xb6, 0x8d, 0x60 } };
  403.  
  404. /////////////////////////////////////////////////////////////////////////////
  405. // CTestContainer98App initialization
  406.  
  407. static const LPCTSTR SETTINGS_KEY = _T( "Settings" );
  408.  
  409. void CTestContainer98App::LoadRegistrySettings()
  410. {
  411.    m_options.m_tUserMode = GetProfileInt( SETTINGS_KEY, _T( "UserMode" ),
  412.       FALSE );
  413.    m_options.m_tAllowWindowless = GetProfileInt( SETTINGS_KEY, _T(
  414.       "AllowWindowless" ), TRUE );
  415.    m_options.m_tQuickActivation = GetProfileInt( SETTINGS_KEY, _T(
  416.       "QuickActivation" ), TRUE );
  417.    m_options.m_tTwoPassDrawing = GetProfileInt( SETTINGS_KEY, _T(
  418.       "TwoPassDrawing" ), TRUE );
  419.    m_options.m_tHonorIgnoreActivateWhenVisible = GetProfileInt( SETTINGS_KEY,
  420.       _T( "HonorIgnoreActivateWhenVisible" ), TRUE );
  421.    m_options.m_tUseIPointerInactive = GetProfileInt( SETTINGS_KEY, _T(
  422.       "UseIPointerInactive" ), TRUE );
  423.    m_options.m_tIOleInPlaceSiteEx = GetProfileInt( SETTINGS_KEY, _T(
  424.       "IOleInPlaceSiteEx" ), TRUE );
  425.    m_options.m_tIOleInPlaceSiteWindowless = GetProfileInt( SETTINGS_KEY, _T(
  426.       "IOleInPlaceSiteWindowless" ), TRUE );
  427.    m_options.m_tIAdviseSinkEx = GetProfileInt( SETTINGS_KEY, _T(
  428.       "IAdviseSinkEx" ), TRUE );
  429.    m_options.m_tSBindHost = GetProfileInt( SETTINGS_KEY, _T( "SBindHost" ),
  430.       TRUE );
  431. }
  432.  
  433. void CTestContainer98App::SaveRegistrySettings()
  434. {
  435.    WriteProfileInt( SETTINGS_KEY, _T( "UserMode" ), m_options.m_tUserMode );
  436.    WriteProfileInt( SETTINGS_KEY, _T( "AllowWindowless" ),
  437.       m_options.m_tAllowWindowless );
  438.    WriteProfileInt( SETTINGS_KEY, _T( "QuickActivation" ),
  439.       m_options.m_tQuickActivation );
  440.    WriteProfileInt( SETTINGS_KEY, _T( "TwoPassDrawing" ),
  441.       m_options.m_tTwoPassDrawing );
  442.    WriteProfileInt( SETTINGS_KEY, _T( "UseIPointerInactive" ),
  443.       m_options.m_tUseIPointerInactive );
  444.    WriteProfileInt( SETTINGS_KEY, _T( "HonorIgnoreActivateWhenVisible" ),
  445.       m_options.m_tHonorIgnoreActivateWhenVisible );
  446.    WriteProfileInt( SETTINGS_KEY, _T( "IOleInPlaceSiteEx" ),
  447.       m_options.m_tIOleInPlaceSiteEx );
  448.    WriteProfileInt( SETTINGS_KEY, _T( "IOleInPlaceSiteWindowless" ),
  449.       m_options.m_tIOleInPlaceSiteWindowless );
  450.    WriteProfileInt( SETTINGS_KEY, _T( "IAdviseSinkEx" ),
  451.       m_options.m_tIAdviseSinkEx );
  452.    WriteProfileInt( SETTINGS_KEY, _T( "SBindHost" ), m_options.m_tSBindHost );
  453. }
  454.  
  455. BOOL CTestContainer98App::InitInstance()
  456. {
  457.     // Initialize OLE libraries
  458.     if( !AfxOleInit() )
  459.     {
  460.         AfxMessageBox( IDP_OLE_INIT_FAILED );
  461.         return( FALSE );
  462.     }
  463.  
  464.     AfxEnableControlContainer();
  465.  
  466.     // Standard initialization
  467.     // If you are not using these features and wish to reduce the size
  468.     //  of your final executable, you should remove from the following
  469.     //  the specific initialization routines you do not need.
  470.  
  471. #ifdef _AFXDLL
  472.     Enable3dControls();         // Call this when using MFC in a shared DLL
  473. #else
  474.     Enable3dControlsStatic();   // Call this when linking to MFC statically
  475. #endif
  476.  
  477.     // Change the registry key under which our settings are stored.
  478.     // You should modify this string to be something appropriate
  479.     // such as the name of your company or organization.
  480.     SetRegistryKey( _T( "Microsoft" ) );
  481.  
  482.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  483.  
  484.    LoadRegistrySettings();
  485.  
  486.     // Register the application's document templates.  Document templates
  487.     //  serve as the connection between documents, frame windows and views.
  488.  
  489.     CSingleDocTemplate* pDocTemplate;
  490.     pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(
  491.       CTestContainer98Doc ), RUNTIME_CLASS( CMainFrame ), RUNTIME_CLASS(
  492.       CTestContainer98View ) );
  493.     pDocTemplate->SetContainerInfo( IDR_TC98TYPE_CNTR_IP );
  494.     AddDocTemplate( pDocTemplate );
  495.  
  496.     // Connect the COleTemplateServer to the document template.
  497.     //  The COleTemplateServer creates new documents on behalf
  498.     //  of requesting OLE containers by using information
  499.     //  specified in the document template.
  500.     m_server.ConnectTemplate( clsid, pDocTemplate, FALSE );
  501.         // Note: SDI applications register server objects only if /Embedding
  502.         //   or /Automation is present on the command line.
  503.  
  504.    // Parse command line for standard shell commands, DDE, file open
  505.     CTCCommandLineInfo cmdInfo( &m_options );
  506.     ParseCommandLine( cmdInfo );
  507.  
  508.     // Check to see if launched as OLE server
  509.     if( cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated )
  510.     {
  511.         // Application was run with /Embedding or /Automation.  Don't show the
  512.         //  main window in this case.
  513.         return( TRUE );
  514.     }
  515.  
  516.     // When a server application is launched stand-alone, it is a good idea
  517.     //  to update the system registry in case it has been damaged.
  518.     m_server.UpdateRegistry( OAT_DISPATCH_OBJECT );
  519.     COleObjectFactory::UpdateRegistryAll();
  520.  
  521.     // Dispatch commands specified on the command line
  522.     if( !ProcessShellCommand( cmdInfo ) )
  523.    {
  524.       return( FALSE );
  525.    }
  526.  
  527.     // The main window has been initialized, so show and update it.
  528.     m_pMainWnd->ShowWindow( SW_SHOW );
  529.     m_pMainWnd->UpdateWindow();
  530.  
  531.     return( TRUE );
  532. }
  533.  
  534. /////////////////////////////////////////////////////////////////////////////
  535. // CAboutDlg dialog used for App About
  536.  
  537. class CAboutDlg : public CDialog
  538. {
  539. public:
  540.     CAboutDlg();
  541.  
  542. // Dialog Data
  543.     //{{AFX_DATA(CAboutDlg)
  544.     enum { IDD = IDD_ABOUTBOX };
  545.     //}}AFX_DATA
  546.  
  547.     // ClassWizard generated virtual function overrides
  548.     //{{AFX_VIRTUAL(CAboutDlg)
  549.     protected:
  550.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  551.     //}}AFX_VIRTUAL
  552.  
  553. // Implementation
  554. protected:
  555.     //{{AFX_MSG(CAboutDlg)
  556.         // No message handlers
  557.     //}}AFX_MSG
  558.     DECLARE_MESSAGE_MAP()
  559. };
  560.  
  561. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  562. {
  563.     //{{AFX_DATA_INIT(CAboutDlg)
  564.     //}}AFX_DATA_INIT
  565. }
  566.  
  567. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  568. {
  569.     CDialog::DoDataExchange(pDX);
  570.     //{{AFX_DATA_MAP(CAboutDlg)
  571.     //}}AFX_DATA_MAP
  572. }
  573.  
  574. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  575.     //{{AFX_MSG_MAP(CAboutDlg)
  576.         // No message handlers
  577.     //}}AFX_MSG_MAP
  578. END_MESSAGE_MAP()
  579.  
  580. // App command to run the dialog
  581. void CTestContainer98App::OnAppAbout()
  582. {
  583.     CAboutDlg aboutDlg;
  584.     aboutDlg.DoModal();
  585. }
  586.  
  587. /////////////////////////////////////////////////////////////////////////////
  588. // CTestContainer98App commands
  589.  
  590.  
  591. void CTestContainer98App::OnOptionsTraceLevelNone()
  592. {
  593.    SetTraceLevel( TRACELEVEL_NONE );
  594. }
  595.  
  596. void CTestContainer98App::OnOptionsTraceLevelNormal()
  597. {
  598.    SetTraceLevel( TRACELEVEL_NORMAL );
  599. }
  600.  
  601. void CTestContainer98App::OnOptionsTraceLevelVerbose()
  602. {
  603.    SetTraceLevel( TRACELEVEL_VERBOSE );
  604. }
  605.  
  606. void CTestContainer98App::OnUpdateOptionsTraceLevelNone( CCmdUI* pCmdUI )
  607. {
  608.    pCmdUI->SetRadio( GetTraceLevel() == TRACELEVEL_NONE );
  609. }
  610.  
  611. void CTestContainer98App::OnUpdateOptionsTraceLevelNormal( CCmdUI* pCmdUI )
  612. {
  613.    pCmdUI->SetRadio( GetTraceLevel() == TRACELEVEL_NORMAL );
  614. }
  615.  
  616. void CTestContainer98App::OnUpdateOptionsTraceLevelVerbose( CCmdUI* pCmdUI )
  617. {
  618.    pCmdUI->SetRadio( GetTraceLevel() == TRACELEVEL_VERBOSE );
  619. }
  620.  
  621. void CTestContainer98App::OnFileRegisterControls()
  622. {
  623.    CRegisterControlsDlg dlg;
  624.  
  625.    dlg.DoModal();
  626. }
  627.