Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
tarou iiyama
|
Aug 3, 2006 - 1:33 AM
|
Hello.
About CSizeFixControlBar which asked you a question before. I do an existence check of a bar. Will it be good?
int CSizeFixControlBar::CheckBar( CExtControlBar * pECBObj ) { CFrameWnd *pCFrameWnd; pCFrameWnd = (CFrameWnd *)AfxGetMainWnd();
for( POSITION pos = pCFrameWnd->m_listControlBars.GetHeadPosition(); pos != NULL; ) { // get state info for each bar CExtControlBar * pBar = (CExtControlBar *)pCFrameWnd->m_listControlBars.GetNext( pos );
if( pBar == pECBObj ){ return 1; } } return -1; }
|
|
Technical Support
|
Aug 7, 2006 - 10:10 AM
|
You correctly verified if the control bar exists in the frame window. But this code can be replaced with one invocation of the CList:Find() method applied to the CFrameWnd::m_listControlBars object.
|
|