CMDIChildText::CMDIChildText() { HINSTANCE hResource = GetApp()->GetResourceHandle(); HMENU hChildMenu = LoadMenu(hResource, _T("MdiMenuText")); SetHandles(hChildMenu, NULL); SetView(m_TextView); }
HRESULT CRefClient::Initialize(IWbemServices* pNameSpace) /////////////////////////////////////////////////////////////////// // // Initialize will create the refresher and configuration manager // and set the IWbemObjectAccess handles which are used to access // property values of the instances. // // Returns a status code. Use the SUCCEEDED() and FAILED() macros // to interpret results. // /////////////////////////////////////////////////////////////////// { HRESULT hRes = WBEM_NO_ERROR; // Copy the namespace pointer // ========================== if ( NULL == pNameSpace ) return WBEM_E_INVALID_PARAMETER; //Cleanup: in case this method nas been called more than once if (m_pNameSpace != NULL) m_pNameSpace->Release(); if (m_pRefresher != NULL) m_pRefresher->Release(); if (m_pConfig != NULL) m_pConfig->Release(); m_pNameSpace = pNameSpace; m_pNameSpace->AddRef(); // Create the refresher and refresher manager // ========================================== hRes = CoCreateInstance( CLSID_WbemRefresher, NULL, CLSCTX_INPROC_SERVER, IID_IWbemRefresher, (void**) &m_pRefresher ); if ( FAILED( hRes ) ) return hRes; hRes = m_pRefresher->QueryInterface( IID_IWbemConfigureRefresher, (void**) &m_pConfig ); if ( FAILED( hRes ) ) { m_pRefresher->Release(); return hRes; } // Set the access handles // ====================== hRes = SetHandles(); return hRes; }
BOOL CHelloWnd::Create( LPCTSTR szTitle, LONG style /* = 0 */, const RECT& rect /* = rectDefault */, CMDIFrameWnd* parent /* = NULL */) { // Setup the shared menu SetHandles(::LoadMenu(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_HELLO)), NULL); // Register a custom WndClass and create a window. // This must be done because CHelloWnd has a custom icon. LPCTSTR lpszHelloClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, LoadCursor(NULL, IDC_ARROW), (HBRUSH) (COLOR_WINDOW+1), LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_HELLO))); return CMDIChildWnd::Create(lpszHelloClass, szTitle, style, rect, parent); }
// CMDIChildMax definitions CMDIChildMax::CMDIChildMax() { m_Menu.LoadMenu(_T("MdiMenuMax")); SetHandles(m_Menu, NULL); SetView(m_MaxView); }