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 |
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
Hi all I have a application
|
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
|
|
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
|
|
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
|
|
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
|
|
|
|
ngo duc trong
|
Oct 7, 2009 - 3:36 AM
|
|
|
|
|
Dirk lindner
|
Oct 6, 2009 - 3:12 AM
|
Hello, i have a problem with the Internationalization of the line edit. If i use a English Operation System(XP) and set the language via g_ResourceManager->SetLangIdDesired( __EXT_MFC_LANG_ID_GERMAN ); the right click menu of the edit control will be always shown in english. You can see the same effect in the skinable example with a German Operation System(XP) The right click menu in the toolbar show German strings and is not skined .
What must i do to fix that ?
Greats Dirk Lindner
|
|
|
Technical Support
|
Oct 6, 2009 - 1:20 PM
|
Prof-UIS does not localize the standard ID_EDIT_*** commands. The edit control initializes and displays context menu in the CExtEditBase::OnContextMenu() method. This method assumes the command manager is already containing the localized descriptions of all the standard ID_EDIT_*** commands. If some command is not in the command manager, then the international text is provided for it. How the command can contain the standard editor commands descriptions? Most of the frame window based applications have the Edit menu with these commands and they are translated by the application developers.
|
|
|
esraa khedr
|
Oct 5, 2009 - 6:55 AM
|
Does Prof-UIS run under .NET? Regards,
|
|
|
Technical Support
|
Oct 5, 2009 - 1:04 PM
|
Prof-UIS is an MFC extension library. Prof-UIS extends features of MFC library. Both libraries are for native app development. You can use them in mixed native/.net projects.
|
|
|
Takis Takoglou
|
Oct 5, 2009 - 2:49 AM
|
Good day!
I am developing a program using MFC.
When i added some features from the ProfUIS library (class CMainFrame : public CExtNCW < CFrameWnd > , CExtToolControlBar etc.) i noticed the following abnormal behavior: When the program starts it is in the maximized position by default.
Sometimes the maximized position occupies correctly the whole screen (except from the taskbar)
but sometimes it occupies less than the whole screen (about half an inch from the top is unoccupied and shows the desktop)
Note that if the program starts correctly occupying the screen it preserves this correct state through runtime.
By using the getClientRect() of the main window i find that indeed the clientRect is less than it should when the whole screen isn’t occupied.
Anyone has encountered something similar? Any guesses? Thanx in advance,
Stakon.
|
|
|
Technical Support
|
Oct 30, 2009 - 2:34 PM
|
The CMainFrame::ActivateFrame() virtual methods in all the frame based Prof-UIS sample applications performs the main frame position restoring when invoked first time. But if sample app runs first time on a computer, then the CMainFrame::ActivateFrame() method just shows the main frame window like your app do. Here is how to make the SDI_DynamicBars sample application starting exactly like your app with the same theme:
1) Run it once, select the Office 2007 R1 theme and close it.
2) Remove the following registry keys using regedit.exe tool:
HKEY_CURRENT_USER\Software\Foss\SDI_DynamicBars\ProfUIS\Profiles\SDI_DynamicBars\ControlBar HKEY_CURRENT_USER\Software\Foss\SDI_DynamicBars\ProfUIS\Profiles\SDI_DynamicBars\DynamicBarSite
3) Run it again.
At the 3rd step, the sample application will run initially maximized without window position restoring and it will use the Office 2007 R1 theme. We didn’t noticed any problems. You can repeat this test with other sample apps.
|
|
|
Technical Support
|
Oct 5, 2009 - 1:04 PM
|
We improved the CExtNCW template class in Prof-UIS 2.85 and most of known window positioning issues were closed. Which Prof-UIS version is used in your project?
|
|
|
Technical Support
|
Oct 5, 2009 - 12:50 PM
|
We improved the CExtNCW template class in Prof-UIS 2.85 and most of known window positioning issues were closed. Which Prof-UIS version is used in your project?
|
|
|
Takis Takoglou
|
Oct 6, 2009 - 12:56 AM
|
Hi, I am using Prof-UIS 2.87 since May when it was available for download from your ftp.
|
|
|
Technical Support
|
Oct 15, 2009 - 1:03 PM
|
Is it possible to reproduce this using the FullScreenState sample application? Which Windows version, Windows desktop theme and Prof-UIS UI theme should we use for testing?
|
|
|
Takis Takoglou
|
Oct 29, 2009 - 6:59 AM
|
Hello, I am using: - Windows XP Professional version 2002 Service Pack 3
- XP theme ( but the problem appears in others pc which probably have other themes )
- CExtPaintManagerOffice2007_R1 my application is using pFrame->ShowWindow(SW_SHOWMAXIMIZED);
pFrame->UpdateWindow();
instead of ActivateFrame() Unfortunately i cannot reproduce the error in your sample but i am working on it when i have time.
|
|
|
Anil Siddhpura
|
Oct 3, 2009 - 12:58 AM
|
Hi,
I have created grid and inside that i created several radiobutton using CExtCellRadioButton.
For example say there are 5 radio buttons, now as radiobutton functions, it should be selected only one radio button at a time. Imean when you select one radio button the others must be disselected.
But in this i can select all of the radio button at a time.
So how can i enable the functionality that it should select only one radio button & disselect all the others automatically?
|
|
|
Technical Support
|
Oct 6, 2009 - 1:21 PM
|
|
|
|
|
Anil Siddhpura
|
Oct 7, 2009 - 5:51 AM
|
Hi,
Thanks for the reply.
But how can i defferentiate between checkbox and radiobutton. I want that functionality only in radiobuttons. In that overridden function what shold i check for radiobutton?
|
|
|
Technical Support
|
Oct 7, 2009 - 11:33 AM
|
You can check the run-time classes of the grid cells in your grid window. Or you can check the cell locations (row and/or column indices).
|
|
|
Technical Support
|
Oct 5, 2009 - 8:08 AM
|
The grid control always assumes each grid cell is individual and not linked with any other. The checked state changing can be handled in the CExtGridCell::OnSetCheck() virtual method or in the CExtGridWnd::OnGridCellSetCheck() virtual method. For instance, you can implement the CExtGridWnd::OnGridCellSetCheck() virtual method in your CExtGridWnd-derived class and un-check one radio button when other becomes checked by user.
|
|
|
Anil Siddhpura
|
Oct 6, 2009 - 12:34 AM
|
Hi,
Can you show me that with an example?
Thanks...
|
|
|
Vinit Patil
|
Sep 29, 2009 - 11:05 PM
|
when I open the multiple tab and switch from one tab to another, all tabs child winodw get Minimise and activated window refresh at last. I am using is below sample code. Code: CExtTabMdiWhidbeyWnd m_wndMdiTabs; if( ! m_wndMdiTabs.Create(
this,
CRect(0,0,0,0),
UINT(__EXT_MFC_IDC_STATIC),
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,
__ETWS_MDI_DEFAULT|__ETWS_HIDE_ICONS
|__ETWS_SHOW_BTN_TAB_LIST|__ETWS_ENABLED_BTN_TAB_LIST
|__ETWS_ITEM_DRAGGING|__ETWS_ENABLED_BTN_UP|__ETWS_ENABLED_BTN_DOWN|__ETWS_ENABLED_BTN_CLOSE
)
)
{
TRACE0("Failed to create m_wndMdiTabs\n");
return -1; // fail to create
}
m_wndMdiTabs.OrientationSet( __ETWS_ORIENT_TOP );
m_wndMdiTabs.OnTabWndSyncVisibility(); I check same behavoiur in ProfUI sample applicastion , but getting the same action (e.g In RibbonBarMDI sample example open the 4-5 tabs and switch from one to anoter tabs we will see the problem.).I set Initial state of all child view in max mode.I am using Vista OS , ProfUIS284.dll and ProfUIS284.libs. Any thing else please let me know
Thanks in advance
|
|
|
Technical Support
|
Oct 1, 2009 - 12:46 PM
|
We improved MDI interface support in 2.85. This issue looks like fixed.
|
|
|
Vinit Patil
|
Sep 29, 2009 - 10:39 PM
|
In shell dialog ,first entry of the dialog not selected directly, I am using shell dialog for open file. Below is the sample code : CExtShellDialogFile dlgShellFile(NULL,CExtShellDialogFile::__EFDT_OPEN_SINGLE);
dlgShellFile.m_comboFileTypes.SetFilter(
filter
);
if( dlgShellFile.DoModal() == IDOK )
{
CString pathname;
pathname = LPCTSTR(dlgShellFile.m_arrRetValNames[0]);
OpenDocumentFile( pathname );
} I check this code for Operating System " Vista "
Also I check the prof UI available sample examples. (e.g AviFrames) I got the same action, first entry from dialog box is not selecting. Any thing else please let me know. Thanks in advance.
|
|
|
Technical Support
|
Oct 1, 2009 - 12:47 PM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
INT CExtShellListCtrl::FindItemByName(
__EXT_MFC_SAFE_LPCTSTR strName,
INT nStartIndex, // = -1
bool bCompareNoCase // = true
)
{
ASSERT_VALID( this );
if( _tcslen( strName ) == 0 )
return -1;
if( GetSafeHwnd() == NULL )
return -1;
INT nItemCount = GetItemCount();
if( nItemCount <= 0 )
return -1;
INT nItemIndex, nRetVal = -1;
for( nItemIndex = ( nStartIndex < 0 ) ? 0 : ( nStartIndex + 1 );
nItemIndex < nItemCount;
nItemIndex ++
)
{
CExtShellItemData * pShellItemData = (CExtShellItemData*)GetItemData( nItemIndex );
// first, try display name
CExtSafeString _strNameBuffer = pShellItemData->m_pidlAbsolute.GetDisplayNameOf();
LPCTSTR _strName = LPCTSTR(_strNameBuffer);
bool bEqual = false;
if( bCompareNoCase )
bEqual = ( ::_tcsicmp( _strName, LPCTSTR(strName) ) == 0 ) ? true : false;
else
bEqual = ( ::_tcscmp( _strName, LPCTSTR(strName) ) == 0 ) ? true : false;
if( bEqual )
{
nRetVal = nItemIndex;
break;
}
// second, try file name
_strNameBuffer = pShellItemData->m_pidlAbsolute.GetPath();
_strName = LPCTSTR(_strNameBuffer);
INT nPosChr = _strNameBuffer.ReverseFind( _T(’\\’) );
if( nPosChr > 0 )
_strName += nPosChr + 1;
bEqual = false;
if( bCompareNoCase )
bEqual = ( ::_tcsicmp( _strName, LPCTSTR(strName) ) == 0 ) ? true : false;
else
bEqual = ( ::_tcscmp( _strName, LPCTSTR(strName) ) == 0 ) ? true : false;
if( bEqual )
{
nRetVal = nItemIndex;
break;
}
}
return nRetVal;
}
Please note, the automatic shell list view item selection is performed for the file open dialogs only and only of the CExtShellDialogFile::m_bFilesMustExist or CExtShellDialogFile::m_bPathMustExist property is set to true.
|
|
|
han chong tan
|
Sep 29, 2009 - 2:16 AM
|
I’m having the same problem as in http://www.prof-uis.com/prof-uis/tech-support/support-forum/crash-in-profilebarstateload-57693.aspx.#@lt;/p>
try/catch block doesn’t prevent the crash:
try
{
if( ! CExtControlBar::ProfileBarStateLoad(this,theApp.m_pszRegistryKey,theApp.m_pszProfileName,theApp.m_pszProfileName,&m_dataFrameWP, true, true, ((HKEY)(ULONG_PTR)((LONG)-2147483647)), true))
{
CRect rect;
GetWindowRect(&rect);
int nX = rect.Width();
//int nY = rect.Height()/3;
int nY = 400;
m_wndMFSearchBar.SetInitDesiredSizeHorizontal( CSize(nX,nY) );
m_wndMFSearchBar.DockControlBarInnerOuter(AFX_IDW_DOCKBAR_BOTTOM, true );
m_wndMFSearchBar.AutoHideModeSet(false, true, true, false);
RecalcLayout();
}
}
catch (...)
{
CRect rect;
GetWindowRect(&rect);
int nX = rect.Width();
//int nY = rect.Height()/3;
int nY = 400;
m_wndMFSearchBar.SetInitDesiredSizeHorizontal( CSize(nX,nY) );
m_wndMFSearchBar.DockControlBarInnerOuter(AFX_IDW_DOCKBAR_BOTTOM, true );
m_wndMFSearchBar.AutoHideModeSet(false, true, true, false);
RecalcLayout();
}
It crashed here (inside CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState()):
if( ( pExtBar->IsFixedMode() )
|| ( pExtBar->IsFixedDockStyle() )
)
{
pExtBar was null.
Any other way to prevent the crash?
|
|
|
Andre Vautour
|
Apr 7, 2010 - 7:32 AM
|
I’ve also hit this problem. The context is the following. A layout file was created. A later build of the application removed a toolbar that the user had as a floatting toolbar when the previous layout was created. Once the new build of the application loads the old layout, the following code crash throws a NULL pointer exception: in CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState:
// the third pass will move independent floating bars // into valid positions { OuterItemData_t _oid = arrOuterProps[i]; CExtControlBar * pExtBar = STATIC_DOWNCAST( CExtControlBar, GetControlBar( _oid.m_nBarID ) ); || ( pExtBar->IsFixedDockStyle() ) ) { for( i = 0; i < arrOuterProps.GetSize(); i++ ) if( ( pExtBar->IsFixedMode() )
if(pExtBar == NULL)continue; if || ( pExtBar->IsFixedDockStyle() ) ) ( ( pExtBar->IsFixedMode() ){
pExtBar is NULL as the toolbar no longer exists in the new build of the application. That is throwing an exception that seems to be caught later, but is seems to corrupt AfxActivateActCtx/AfxDeactivateActCtx state invariant that states that you can only deactivate something when it is the last thing to have been activated (top of the activation stack). That is in turn causing an exception to be thrown later on in our application’s lifetime (the next time AfxDeactivateActCtx is called). So, simply catching the NULL pointer exception still leaves the application in an inconsistent state.Could a NULL check be added before pExtBar is dereferenced to avoid these problems?
|
|
|
Technical Support
|
Apr 8, 2010 - 9:58 AM
|
The NULL checking conditions were added into the CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState() method:
void CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState(
const CDockState & state,
const CExtControlBar::OuterPropsArr_t & arrOuterProps,
bool bSerializeFixedBarsState,
bool bSerializeResizableBarsState
)
{
// first pass through barinfo’s sets the m_pBar member correctly
// creating floating frames if necessary
int i = 0;
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
CControlBar * pExistingBar = GetControlBar( pInfo->m_nBarID );
if( pExistingBar != NULL )
{
if( (! pExistingBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pExistingBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pExistingBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
}
if( pInfo->m_bFloating )
{
// need to create floating frame to match
CMiniDockFrameWnd * pDockFrame =
CreateFloatingFrame(
pInfo->m_bHorz ?
CBRS_ALIGN_TOP : CBRS_ALIGN_LEFT
);
ASSERT( pDockFrame != NULL) ;
CRect rcWnd( pInfo->m_pointPos, CSize(10, 10) );
pDockFrame->CalcWindowRect( &rcWnd );
pDockFrame->SetWindowPos(
NULL,
rcWnd.left, rcWnd.top, 0, 0,
SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE
);
CDockBar * pDockBar = (CDockBar *)
pDockFrame->GetDlgItem( AFX_IDW_DOCKBAR_FLOAT );
ASSERT( pDockBar != NULL );
ASSERT_KINDOF( CDockBar, pDockBar );
pInfo->m_pBar = pDockBar;
} // if( pInfo->m_bFloating )
else // regular dock bar or toolbar
{
pInfo->m_pBar =
pExistingBar; // GetControlBar( pInfo->m_nBarID );
if( pInfo->m_pBar == NULL )
continue;
} // else from if( pInfo->m_bFloating )
pInfo->m_pBar->m_nMRUWidth = pInfo->m_nMRUWidth;
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
// update new outer props
for( i = 0; i < arrOuterProps.GetSize(); i++ )
{
OuterItemData_t _oid = arrOuterProps[i];
CControlBar * pBarTmp = GetControlBar( _oid.m_nBarID );
if( pBarTmp == NULL )
continue;
CExtControlBar * pExtBar = DYNAMIC_DOWNCAST( CExtControlBar, pBarTmp );
if( pExtBar == NULL )
continue;
if( ( pExtBar->IsFixedMode() )
|| ( pExtBar->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
pExtBar->m_ptFloatHelper = _oid.m_ptFloatHelper;
pExtBar->m_sizeDockedH = _oid.m_sizeDockedH;
pExtBar->m_sizeDockedV = _oid.m_sizeDockedV;
pExtBar->m_sizeFloated = _oid.m_sizeFloated;
pExtBar->_AffixmentSetOuter( &_oid.m_AffixmentData );
} // for( i = 0; i < arrOuterProps.GetSize(); i++ )
// the second pass will actually dock all of the control bars and
// set everything correctly
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
if( pInfo->m_pBar == NULL )
continue;
if( (! pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( pInfo->m_pBar->m_pDockContext != NULL
&& pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar))
)
((CExtControlBar*)(pInfo->m_pBar))->m_ptFloatHelper
= pInfo->m_ptMRUFloatPos;
pInfo->m_pBar->SetBarInfo( pInfo, this );
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
// the third pass will move independent floating bars
// into valid positions
for( i = 0; i < arrOuterProps.GetSize(); i++ )
{
OuterItemData_t _oid = arrOuterProps[i];
CControlBar * pBarTmp = GetControlBar( _oid.m_nBarID );
if( pBarTmp == NULL )
continue;
CExtControlBar * pExtBar = DYNAMIC_DOWNCAST( CExtControlBar, pBarTmp );
if( pExtBar == NULL )
continue;
if( ( pExtBar->IsFixedMode() )
|| ( pExtBar->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( ! _oid.m_bFloating )
continue;
CSize _sizeFloating = _oid.m_sizeFloated;
CRect rcFrameInitial( _oid.m_ptFloatHelper, _sizeFloating /*_oid.m_sizeFloated*/ );
CExtMiniDockFrameWnd * pMiniFrame =
DYNAMIC_DOWNCAST(
CExtMiniDockFrameWnd,
pExtBar->GetParentFrame()
);
CRect rcFrameNew =
CExtPaintManager::stat_AlignWndRectToMonitor(
rcFrameInitial
);
if( pMiniFrame != NULL )
{
ASSERT_VALID( pMiniFrame );
CRect rcFrameReal;
pMiniFrame->GetWindowRect( rcFrameReal );
if( rcFrameReal.TopLeft() == rcFrameNew.TopLeft() )
{
pExtBar->DelayShow( _oid.m_bVisible ? TRUE : FALSE );
pMiniFrame->RecalcLayout();
continue;
}
pExtBar->OnNcAreaButtonsReinitialize();
if( ! pExtBar->IsFixedMode() )
pMiniFrame->ModifyStyle( FWS_SNAPTOBARS, 0 );
pMiniFrame->MoveWindow( &rcFrameNew, FALSE );
pMiniFrame->DelayRecalcLayout();
if( _oid.m_bVisible )
{
pExtBar->DelayShow( TRUE );
CSize _size = rcFrameNew.Size();
pExtBar->SetInitDesiredSizeFloating( _size );
pExtBar->m_pDockContext->m_sizeLast = _size;
pMiniFrame->ShowWindow( SW_SHOWNOACTIVATE );
pMiniFrame->MoveWindow( &rcFrameNew, FALSE );
pMiniFrame->RecalcLayout();
CRect rcClientFrame, rcWndFrame;
pMiniFrame->GetClientRect( &rcClientFrame );
pMiniFrame->GetWindowRect( &rcWndFrame );
CRect rcClientBar, rcWndBar;
pExtBar->GetClientRect( &rcClientBar );
pExtBar->GetWindowRect( &rcWndBar );
CSize _sizeBar =
_sizeFloating
- rcClientFrame.Size()
+ rcWndFrame.Size()
- rcClientBar.Size()
+ rcWndBar.Size()
;
pExtBar->OnRepositionSingleChild(
_sizeBar.cx,
_sizeBar.cy,
true
);
}
} // if( pMiniFrame != NULL )
else
pExtBar->FloatControlBar( rcFrameNew.TopLeft() );
} // for( i = 0; i < arrOuterProps.GetSize(); i++ )
// last pass shows all the floating windows that were previously shown
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
if( pInfo->m_pBar == NULL )
continue;
if( (! pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( ! pInfo->m_bFloating )
continue;
CFrameWnd * pFrameWnd =
pInfo->m_pBar->GetParentFrame();
CDockBar * pDockBar = (CDockBar *) pInfo->m_pBar;
ASSERT_KINDOF( CDockBar, pDockBar );
if( pDockBar->GetDockedVisibleCount() > 0 )
{
pFrameWnd->RecalcLayout();
pFrameWnd->ShowWindow( SW_SHOWNA );
for( INT nBar = 1; nBar < pDockBar->m_arrBars.GetSize(); nBar ++ )
{
ASSERT( pDockBar->m_arrBars[0] == NULL );
CControlBar * pBar = (CControlBar *)
pDockBar->m_arrBars[nBar];
if( pBar == NULL )
continue;
if( __PLACEHODLER_BAR_PTR(pBar) )
continue;
CExtControlBar * pExtBar =
DYNAMIC_DOWNCAST(
CExtControlBar,
pBar
);
if( pExtBar == NULL
|| pExtBar->IsFixedMode()
)
continue;
pExtBar->_RecalcNcArea();
}
} // if( pDockBar->GetDockedVisibleCount() > 0 )
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
}
|
|
|
chen xinyu
|
Sep 26, 2009 - 1:47 AM
|
I want to create a CExtResizablePropertySheet object in a CExtControlBar. I derived CExtMyResizablePropertySheet class from CExtResizablePropertySheet. The create function followed: BOOL CExtMyResizablePropertySheet::Create( CWnd * pWndParent )
{
if( !CExtResizablePropertySheet::Create(pWndParent,WS_CHILD|WS_VISIBLE,0) )
{
ASSERT( FALSE );
return FALSE;
}
ModifyStyle(
WS_THICKFRAME|WS_BORDER|WS_CAPTION|WS_SYSMENU,
0,
SWP_FRAMECHANGED
);
ModifyStyleEx(
WS_EX_DLGMODALFRAME|WS_EX_STATICEDGE|WS_EX_CLIENTEDGE,
0,
SWP_FRAMECHANGED
);
return TRUE;
} But the question is when I add "WS_CHILD" ,it goes wrong. After "WS_CHILD" is removed it goes well,but the result is not what I want. I am waiting your help. Thanks.
|
|
|
Technical Support
|
Sep 27, 2009 - 8:06 AM
|
Please replace the CExtChildResizablePropertySheet class in the ResizableChildSheet sample application and try to reproduce the problem. Then send us the modified project to the support mail box at this web site.
|
|
|
Halfdom LCap
|
Sep 25, 2009 - 11:04 AM
|
I’m using 2.85 version. I refer from the example of "MDI_DynamicInnerOuterBars ". I ’m trying to use CExtListCtrl in place of CSimpleDynamicEdit in the sy The source of CSimpleDynamicEdit is
in MainFrm.cpp
pLogEdit = new CSimpleDynamicEdit;
VERIFY(pLogEdit->Create(
m_parrControlBars[i]->m_hWnd,
NULL) );
pCpriEdit->SetWindowText("Log Monitor"); How to use CExtListCtrl in place of CSimpleDynamicEdit?
|
|
|
Technical Support
|
Oct 3, 2009 - 6:33 AM
|
We received your project. The code at line 400 in Mainfrm.cpp is absolutely OK:
. . . . .
#if 1
CSimpleDynamicListViewCtrl * pList = new CSimpleDynamicListViewCtrl;
CWnd * pWnd = CWnd::FromHandle(m_parrControlBars[i]->m_hWnd);
VERIFY(
pList->Create(
WS_CHILD|WS_VISIBLE,
CRect(0,0,1,1),
pWnd,
UINT(555)
)
);
#else
. . . . .
It simply creates фт un-initialized list view control without items and columns.
|
|
|
Technical Support
|
Sep 26, 2009 - 9:46 AM
|
You should just copy it into your project’s source code and use it instead of the editor. If you have any difficulties, you can send us your startup project so we can modify it for you.
|
|
|
Halfdom LCap
|
Sep 30, 2009 - 3:15 PM
|
|
|
|
|
Technical Support
|
Sep 25, 2009 - 12:20 PM
|
Here is the class you should use:
class CSimpleDynamicListViewCtrl : public CExtNCSB < CExtListCtrl > { public: CSimpleDynamicListViewCtrl() : CExtNCSB < CExtListCtrl > ( true , true ) { } virtual void PostNcDestroy() { delete this; } };
|
|
|
Halfdom LCap
|
Sep 25, 2009 - 4:50 PM
|
How can I get the "CSimpleDynamicListViewCtrl " class?
|
|
|
nakzu e
|
Sep 25, 2009 - 10:45 AM
|
I ’m using 2.85 version. I refered the example of "MDI_DynamicInnerOuterBars". I’m tying to use CExtlistctrl in place of CSimpleDynamicEdit in a dynamic bar. An assertion is occurred. The orignal CSimpleDynamicEdit is
pLogEdit = new CSimpleDynamicEdit; VERIFY( pLogEdit->Create( m_parrControlBars[i]->m_hWnd, NULL ) ); pCpriEdit->SetWindowText("Log Monitor");
|
|
|
Halfdom LCap
|
Sep 25, 2009 - 11:00 AM
|
|
|
|
|
nakzu e
|
Sep 25, 2009 - 10:50 AM
|
I’m using 2.85 version. I refer from the example of "MDI_DynamicInnerOuterBars ". I ’m trying to use CExtListCtrl in place of CSimpleDynamicEdit in the sy
The source of CSimpleDynamicEdit is
in MainFrm.cpp
pLogEdit = new CSimpleDynamicEdit;
VERIFY(pLogEdit->Create(
m_parrControlBars[i]->m_hWnd,
NULL) );
pCpriEdit->SetWindowText("Log Monitor");
|
|
|
Halfdom LCap
|
Sep 25, 2009 - 11:01 AM
|
|
|
|
|
Technical Support
|
Sep 25, 2009 - 12:17 PM
|
You should just create a list view common control instead of editor window.
|
|
|
nakzu e
|
Sep 25, 2009 - 10:45 AM
|
I ’m using 2.85 version. I refered the example of "MDI_DynamicInnerOuterBars". I’m tying to use CExtlistctrl in place of CSimpleDynamicEdit in a dynamic bar. An assertion is occurred. The orignal CSimpleDynamicEdit is
pLogEdit = new CSimpleDynamicEdit; VERIFY( pLogEdit->Create( m_parrControlBars[i]->m_hWnd, NULL ) ); pCpriEdit->SetWindowText("Log Monitor");
|
|
|
Bart Kampers
|
Sep 25, 2009 - 2:51 AM
|
How can I cutomize the font in a CExtComboBox? I tried to override OnQueryFont but this method is never reached.
|
|
|
Technical Support
|
Sep 29, 2009 - 1:21 PM
|
It looks like you are using some very old Prof-UIS version, correct?
|
|
|
Bart Kampers
|
Sep 30, 2009 - 12:50 AM
|
|
|
|
|
Technical Support
|
Oct 1, 2009 - 12:47 PM
|
|
|
|
|
Bart Kampers
|
Sep 28, 2009 - 4:32 AM
|
I created the combobox with: WS_VISIBLE | WS_CHILD | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS.
Now OnQueryFont still is not reached and my application crashes when I click on the combobox.
|
|
|
Technical Support
|
Sep 25, 2009 - 2:03 PM
|
You should use the owner draw combo box. The measuring and painting is already implemented in the CExtComboBoxBase class and the OnQueryFont() virtual method is used for both measuring and painting items.
|
|
|
Bill Olson
|
Sep 23, 2009 - 7:23 AM
|
I am currently experimenting with converting an existing application to Prof UIS. Many things have gone easier than I expected, but I’ve run into one issue I can’t seem to solve. In the examples, I see that the title bar of the application changes when you change the theme. No matter what I do, I can’t seem to get the title bar for the application to change from the standard Windows type. The application is an SDI using Doc-View and the views are CFormViews. I’m getting the same behavior from a new application created from scratch. It seems like something that should be simple, but I haven’t been able to find the answer on my own. Bill
|
|
|
Bill Olson
|
Sep 25, 2009 - 7:28 AM
|
That did it. The call in PreTranslateWindow was not using the template. What’s odd is that I generated a project from scratch with your Visual Studio 2005 wizard, then compiled and ran what the wizard gave me except I experimented with different themes from the default. That doesn’t have the title bar correct either, but the template class is being called correctly there. Thanks for the help, Bill
|
|
|
Bill Olson
|
Sep 23, 2009 - 5:43 PM
|
Did that. Here is the class declaration: class CMainFrame : public CExtNCW < CFrameWnd > Bill
|
|
|
Technical Support
|
Sep 25, 2009 - 6:38 AM
|
The class declaration is OK. But if your main frame class has some overridden virtual methods like PreSubclassWindow(), PreTranslateMessage(), WindowProc(), you should check that these methods invoke correct parent class methods. I.e. the CMainFrame::WindowProc() method should invoke the CExtNCW < CFrameWnd > :: WindowProc() parent class method – not the CFrameWnd::WindowProc() method. Please also note, not all the Prof-UIS paint managers support skinned window non client areas. The Office 2007 and XML skins do have this feature. But they do not skin window non client area if the DWM is running on Windows Vista and Windows 7.
|
|
|
Technical Support
|
Sep 23, 2009 - 10:07 AM
|
The themed window non-client area is provided by the CExtNCW template class. You should make the main frame class in your project derived from the CExtNCW < CFrameWnd > class.
|
|
|
HP Jiang
|
Sep 23, 2009 - 2:16 AM
|
CTimeControlLabel class inherits from CExtBarLabelButton. CTimeControlLabel shows the time on the toolbar every second. but, this instance of CTimeControlLabel causes crashes very about 3 mins, the call stack shows below, who know the reason of crash?
ntdll.dll!7c90120e() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] > msvcr80d.dll!_CrtDbgBreak() Line 89 C msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x781df018, int nLine=716, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00124e04) Line 290 C msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x781df018, int nLine=716, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00124e04) Line 300 + 0x1d bytes C msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x781df018, int nLine=716, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes C mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x781df018, int nLine=716) Line 25 + 0x14 bytes C++ mfc80d.dll!CDC::SetLayout(unsigned long dwSetLayout=0) Line 716 + 0x18 bytes C++ ProfUIS284md.dll!01a6db9c() ProfUIS284md.dll!01a6e1ac() ProfUIS284md.dll!01e10e77() ProfUIS284md.dll!01e147ca()
source code is here,
class CTimeControlLabel : public CExtBarLabelButton { public: CTimeControlLabel( CExtToolControlBar * pBar = NULL, UINT nCmdID = ID_SEPARATOR, UINT nStyle = 0 ); void setCaption(const std::string & strCaption) { m_strCaption = strCaption; //RedrawButton(); } virtual ~CTimeControlLabel(); virtual void Paint( CDC & dc);
virtual CSize CalculateLayout( CDC & dc, CSize sizePreCalc, BOOL bHorz );
private: static std::string m_Title; std::string m_strCaption;
CSize m_sizeFunnyTextCalc, m_sizeFunnyTextWell; };
cppfile
std::string CTimeControlLabel::m_Title = "Training Time"; CTimeControlLabel::CTimeControlLabel(CExtToolControlBar * pBar, UINT nCmdID , UINT nStyle ): CExtBarLabelButton(pBar, nCmdID, nStyle) { }
CTimeControlLabel::~CTimeControlLabel() {
} //*ccccccccccccccccccc void CTimeControlLabel::Paint( CDC & dc) { CFont tile_font; tile_font.CreateFont( 16, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_NORMAL, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily "Arial"); // lpszFacename CFont* pFont = dc.SelectObject(&tile_font); CRect rect(m_ActiveRect); dc.DrawText(m_Title.c_str(), &rect, DT_CENTER); dc.SelectObject(pFont); tile_font.DeleteObject();
CFont font; font.CreateFont( 48, // nHeight 16, // nWidth 0, // nEscapement 0, // nOrientation FW_SEMIBOLD, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily "Arial"); // lpszFacename
CFont* def_font = dc.SelectObject(&font); rect.DeflateRect(0, 10, 0, 0); dc.DrawText(m_strCaption.c_str(), &rect, DT_CENTER|DT_VCENTER); dc.SelectObject(def_font); // Done with the font. Delete the font object. font.DeleteObject();
}//*/
CSize CTimeControlLabel::CalculateLayout( CDC & dc, CSize sizePreCalc, BOOL bHorz ) { ASSERT_VALID( this ); CSize _size = CExtBarButton::CalculateLayout( dc, sizePreCalc, bHorz ); ASSERT( !IsSeparator() ); if( ! m_strCaption.empty() ) { CFont * pOldFont = dc.SelectObject( &g_PaintManager->m_FontNormal ); CRect rcMeasured( 0, 0, 0, 0 ); dc.DrawText( m_strCaption.c_str(), &rcMeasured, DT_LEFT|DT_CALCRECT ); m_sizeFunnyTextWell = rcMeasured.Size(); m_sizeFunnyTextWell.cx += __EXT_TB_BUTTON_TEXT_MARGIN*2; static CString strMeasureTemplate( _T("AapqWZz\nAapqWZz") ); dc.DrawText( strMeasureTemplate, &rcMeasured, DT_LEFT|DT_CALCRECT ); dc.SelectObject( pOldFont ); m_sizeFunnyTextCalc = rcMeasured.Size(); m_sizeFunnyTextCalc.cx += __EXT_TB_BUTTON_TEXT_MARGIN*2; m_sizeFunnyTextCalc.cx = max( m_sizeFunnyTextWell.cx, m_sizeFunnyTextCalc.cy ); m_sizeFunnyTextCalc.cy = max( m_sizeFunnyTextWell.cy, m_sizeFunnyTextCalc.cy ); m_sizeFunnyTextCalc.cx += __EXT_TB_BUTTON_INNER_MARGIN*2; _size.cx = max( m_sizeFunnyTextCalc.cx, _size.cx ); _size.cy += m_sizeFunnyTextCalc.cy + 4; } // if( ! m_strFunnyText.IsEmpty() ) m_ActiveSize = _size; m_ActiveSize.cx = m_ActiveSize.cx + 150; return m_ActiveSize; }
|
|
|
Technical Support
|
Sep 25, 2009 - 6:42 AM
|
If you have 5000 GDI handles, then everything runs notably slower. If you have 1000 GDI handles, then any text is painted with the "System" font, bitmaps and icons are not painted at all. This is the limit of GDI. Normal application does not require such large counts of GDI handles. This is definitively the leak of GDI handles and you should find and fix it.
|
|
|
Technical Support
|
Sep 24, 2009 - 4:19 AM
|
Your source code is OK. Could you insert it into some sample project provided with Prof-UIS (SDI, SDIDOCVIEW), reproduce the crash problem and then send the modified project to us? We guess the problem is really hidden in somewhere else like GDI handle leaks.
|
|
|
HP Jiang
|
Sep 23, 2009 - 11:43 PM
|
From the task manager, I saw the GDI Objects number is about 9998, then the application crashed at above point.
so bad.
wuwh
|
|