本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 ) );
}
示例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();
}
示例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 ) );
}
示例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;
}
示例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;
}
示例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;
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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;
}