当前位置: 首页>>代码示例>>C++>>正文


C++ CHandleMap类代码示例

本文整理汇总了C++中CHandleMap的典型用法代码示例。如果您正苦于以下问题:C++ CHandleMap类的具体用法?C++ CHandleMap怎么用?C++ CHandleMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CHandleMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: afxMapHIMAGELIST

CImageList* PASCAL CImageList::FromHandle(HIMAGELIST h)
{
        CHandleMap* pMap = afxMapHIMAGELIST(TRUE);
        ASSERT(pMap != NULL);
        CImageList* pImageList = (CImageList*)pMap->FromHandle(h);
        ASSERT(pImageList == NULL || pImageList->m_hImageList == h);
        return pImageList;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:8,代码来源:winctrl2.cpp

示例2: afxMapHDC

CDC* PASCAL CDC::FromHandle(HDC hDC)
{
	CHandleMap* pMap = afxMapHDC(TRUE); //create map if not exist
	ASSERT(pMap != NULL);
	CDC* pDC = (CDC*)pMap->FromHandle(hDC);
	ASSERT(pDC == NULL || pDC->m_hDC == hDC);
	return pDC;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:8,代码来源:wingdi.cpp

示例3: afxMapHGDIOBJ

CGdiObject* PASCAL CGdiObject::FromHandle(HGDIOBJ h)
{
	CHandleMap* pMap = afxMapHGDIOBJ(TRUE); //create map if not exist
	ASSERT(pMap != NULL);
	CGdiObject* pObject = (CGdiObject*)pMap->FromHandle(h);
	ASSERT(pObject == NULL || pObject->m_hObject == h);
	return pObject;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:8,代码来源:wingdi.cpp

示例4: afxMapHMENU

CMenu* PASCAL CMenu::FromHandle(HMENU hMenu)
{
	CHandleMap* pMap = afxMapHMENU(TRUE); // create map if not exist
	ASSERT(pMap != NULL);
	CMenu* pMenu = (CMenu*)pMap->FromHandle(hMenu);
	ASSERT(pMenu == NULL || pMenu->m_hMenu == hMenu);
	return pMenu;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:8,代码来源:winmenu.cpp

示例5: AfxGetModuleThreadState

CImageList * PASCAL CImageList::FromHandlePermanent( HIMAGELIST hImageList )
/**************************************************************************/
{
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHIMAGELIST;
    ASSERT( pHandleMap != NULL );
    return( (CImageList *)pHandleMap->LookupPermanent( hImageList ) );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:9,代码来源:imagelst.cpp

示例6: AfxGetModuleThreadState

void PASCAL CMenu::DeleteTempMap()
/********************************/
{
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHMENU;
    ASSERT( pHandleMap != NULL );
    pHandleMap->DeleteTemp();
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:9,代码来源:menu.cpp

示例7: AfxGetModuleThreadState

CDC * PASCAL CDC::FromHandle( HDC hDC )
/*************************************/
{
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHDC;
    ASSERT( pHandleMap != NULL );
    return( (CDC *)pHandleMap->FromHandle( hDC ) );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:9,代码来源:dc.cpp

示例8: ASSERT

BOOL CGdiObject::Attach(HGDIOBJ hObject)
{
	ASSERT(m_hObject == NULL);      // only attach once, detach on destroy
	if (hObject == NULL)
		return FALSE;
	CHandleMap* pMap = afxMapHGDIOBJ(TRUE); // create map if not exist
	ASSERT(pMap != NULL);
	pMap->SetPermanent(m_hObject = hObject, this);
	return TRUE;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:10,代码来源:wingdi.cpp

示例9: afxMapHDC

void CDC::SetOutputDC(HDC hDC)  // Set the Output DC
{
#ifdef _DEBUG
	CHandleMap* pMap = afxMapHDC();
	if (pMap != NULL && pMap->LookupPermanent(m_hDC) == this)
	{
		TRACE0("Cannot Set Output hDC on Attached CDC.\n");
		ASSERT(FALSE);
	}
#endif
	m_hDC = hDC;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:12,代码来源:wingdi.cpp

示例10: ASSERT

BOOL CImageList::Attach(HIMAGELIST hImageList)
{
        ASSERT(m_hImageList == NULL);      // only attach once, detach on destroy
        ASSERT(FromHandlePermanent(hImageList) == NULL);

        if (hImageList == NULL)
                return FALSE;

        CHandleMap* pMap = afxMapHIMAGELIST(TRUE);
        ASSERT(pMap != NULL);

        pMap->SetPermanent(m_hImageList = hImageList, this);
        return TRUE;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:14,代码来源:winctrl2.cpp

示例11: ASSERT

BOOL CMenu::Attach( HMENU hMenu )
/*******************************/
{
    ASSERT( m_hMenu == NULL );
    if( hMenu == NULL ) {
        return( FALSE );
    }
    m_hMenu = hMenu;
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHMENU;
    ASSERT( pHandleMap != NULL );
    pHandleMap->SetPermanent( hMenu, this );
    return( TRUE );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:15,代码来源:menu.cpp

示例12: ASSERT

BOOL CImageList::Attach( HIMAGELIST hImageList )
/**********************************************/
{
    ASSERT( m_hImageList == NULL );
    if( hImageList == NULL ) {
        return( FALSE );
    }
    m_hImageList = hImageList;
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHIMAGELIST;
    ASSERT( pHandleMap != NULL );
    pHandleMap->SetPermanent( hImageList, this );
    return( TRUE );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:15,代码来源:imagelst.cpp

示例13: return

HMENU CMenu::Detach()
/*******************/
{
    if( m_hMenu == NULL ) {
        return( NULL );
    }
    HMENU hMenu = m_hMenu;
    m_hMenu = NULL;
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHMENU;
    ASSERT( pHandleMap != NULL );
    pHandleMap->RemoveHandle( hMenu );
    return( hMenu );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:15,代码来源:menu.cpp

示例14: return

HIMAGELIST CImageList::Detach()
/*****************************/
{
    if( m_hImageList == NULL ) {
        return( NULL );
    }
    HIMAGELIST hImageList = m_hImageList;
    m_hImageList = NULL;
    AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
    ASSERT( pState != NULL );
    CHandleMap *pHandleMap = pState->m_pmapHIMAGELIST;
    ASSERT( pHandleMap != NULL );
    pHandleMap->RemoveHandle( hImageList );
    return( hImageList );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:15,代码来源:imagelst.cpp

示例15: ASSERT

BOOL CMenu::Attach(HMENU hMenu)
{
	ASSERT(m_hMenu == NULL);        // only attach once, detach on destroy
	if (hMenu == NULL)
	{
		return FALSE;
	}
    
	// Capture menu in object first to ensure it does not leak if the map cannot be allocated/expanded 
	m_hMenu=hMenu;

	CHandleMap* pMap = afxMapHMENU(TRUE); // create map if not exist
	ASSERT(pMap != NULL);
	pMap->SetPermanent(m_hMenu, this);
	return TRUE;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:16,代码来源:winmenu.cpp


注:本文中的CHandleMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。