本文整理汇总了C++中CHandleMap::SetPermanent方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandleMap::SetPermanent方法的具体用法?C++ CHandleMap::SetPermanent怎么用?C++ CHandleMap::SetPermanent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandleMap
的用法示例。
在下文中一共展示了CHandleMap::SetPermanent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Attach
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;
}
示例2: Attach
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;
}
示例3: Attach
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 );
}
示例4: Attach
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 );
}
示例5: Attach
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;
}
示例6: Attach
BOOL CDC::Attach( HDC hDC )
/*************************/
{
ASSERT( m_hDC == NULL );
ASSERT( m_hAttribDC == NULL );
if( hDC == NULL ) {
return( FALSE );
}
m_hDC = hDC;
m_hAttribDC = hDC;
AFX_MODULE_THREAD_STATE *pState = AfxGetModuleThreadState();
ASSERT( pState != NULL );
CHandleMap *pHandleMap = pState->m_pmapHDC;
ASSERT( pHandleMap != NULL );
pHandleMap->SetPermanent( hDC, this );
return( TRUE );
}