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 |
|
Dominik Braendlin
|
Feb 8, 2010 - 8:12 AM
|
Dear Support, I am trying to resize 4 docked control bars at runtime. The first code snippet does the docking. The 2nd code snippet should resize the control bars. If there is only one contol bar docked it works but as soon as there is more than one control bar that is docked it fails. What is wrong.
m_wndMainItem0.SetInitDesiredSizeVertical(CSize(cxScreen * 3 / 5, 0)); m_wndMainItem0.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, m_wndMainItem0.DockControlBarIntoTabbedContainer( &m_wndMainItem1, -1, NULL, m_wndMainItem0.DockControlBarIntoTabbedContainer( &m_wndMainItem2, -1, NULL, m_wndMainItem0.DockControlBarIntoTabbedContainer( &m_wndMainItem3, -1, NULL, ShowControlBar(&m_wndMainItem0, TRUE, FALSE); ShowControlBar(&m_wndMainItem1, TRUE, FALSE); ShowControlBar(&m_wndMainItem2, TRUE, FALSE); ShowControlBar(&m_wndMainItem3, TRUE, FALSE); true);false);false);false);
//--------------------------------------------------------------------------- void { m_wndMainItem0.SetInitDesiredSizeVertical(CSize(nDesired, 32767)); m_wndMainItem0.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT); m_wndMainItem1.SetInitDesiredSizeVertical(CSize(nDesired, 32767)); m_wndMainItem1.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT); m_wndMainItem2.SetInitDesiredSizeVertical(CSize(nDesired, 32767)); m_wndMainItem2.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT); m_wndMainItem3.SetInitDesiredSizeVertical(CSize(nDesired, 32767)); m_wndMainItem3.CalcDynamicLayout(nDesired, LM_VERTDOCK|LM_COMMIT); RecalcLayout(); } CMainFrame::OnHomeSub2Item0()int nDesired = 250;
Thanks Adrian
|
|
Technical Support
|
Feb 9, 2010 - 7:46 AM
|
A tabbed group of resizable control bars is also a resizable control bar of the CExtDynTabControlBar type (CExtControlBar -derived of course). The CExtControlBar::_GetNearestTabbedContainer() API returns a pointer to the parent tabbed bar or NULL pointer if the queried bar is not inside the tabbed group. You should resize the tabbed bar group instead of the single bar.
|
|
Robert Fox
|
Sep 20, 2010 - 7:55 AM
|
Thanks, that’s just what I needed. Moved from version 2.53 to 2.90 and suddenly my old way of setting desired sizes (sizing the bar itself and the bar I docked on) wasn’t working anymore. Using the nearest tabbed container works fine.
Jos Smit
|
|
Dominik Braendlin
|
Feb 9, 2010 - 8:32 AM
|
|
|
Technical Support
|
Feb 8, 2010 - 12:47 PM
|
|
|
Dominik Braendlin
|
Feb 9, 2010 - 12:17 AM
|
Thank you for the example. Unfortunately it seems that you are missing my point. I am well able to manage one Bar. My problem arises if there is more than one bar involved. I have four bars that are docked together as a group. That is when your code fails. I need an example that can cope with this kind of situation. Adrian
|
|
tera tera
|
Feb 7, 2010 - 11:17 PM
|
Hello. I want to draw a non-activity button in NcArea of ControlBar.
Please teach a command to draw a non-activity button.
Is there a command drawing the non-activity in CExtBitmap?
|
|
Technical Support
|
Feb 8, 2010 - 12:48 PM
|
Your screen shot demonstrates the undo and redo buttons inserted into the quick access toolbar of the ribbon bar. The undo button is enabled and the redo button is disabled. The ribbon buttons are working exactly like toolbar buttons. If you need to disable some button, then you should add the command updating method for it and use the <code>CCmdUI::Enable()<code> method to disable the command.
|
|
tera tera
|
Feb 8, 2010 - 6:35 PM
|
In NcArea of CExtContorlBar, I draw a button in bitmap.
Therefore I cannot use the CCmdUI command.
I want to draw BitMap for a non-activity image.
Please teach a good command. // ----------------------------------------------------------------------------
/**
* @brief
*/
// ----------------------------------------------------------------------------
CMuBarNcAreaButton::CMuBarNcAreaButton(
CExtControlBar * pBar,
UINT uID,
UINT uIDB,
CString csStr
)
: CExtBarNcAreaButton( pBar )
{
m_uID = uID;
m_iBitmap = 0; if ( uIDB >= 0 ){
PCExtBitmap pBitmap( new CExtBitmap );
pBitmap->LoadBMP_Resource( MAKEINTRESOURCE(uIDB) );
pBitmap->Make32();
pBitmap->AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
m_caBitmap.Add( pBitmap );
}
m_csStr = csStr;
} // ----------------------------------------------------------------------------
/**
* @brief
*/
// ----------------------------------------------------------------------------
void CMuBarNcAreaButton::OnNcAreaDraw( CDC & dc )
{
ASSERT_VALID( this );
ASSERT( dc.GetSafeHdc() != NULL );
ASSERT( OnQueryVisibility() );
if( m_rc.IsRectEmpty() )
return; CExtControlBar * pBar = GetBar();
if( pBar->NcButtons_HandleDraw(
dc,
this,
pBar,
NULL
)
){
return;
} m_bDisabled = true;
CWnd * pWnd = GetBar()->GetWindow(GW_CHILD);
if( pWnd != NULL )
{
m_bDisabled = false;
} if ( m_iBitmap >= 0 ){
// Bitmap表示
CExtBitmap *pBitmap;
pBitmap = SMART(m_caBitmap.GetAt(m_iBitmap));
NcDrawBitMap(
dc ,
pBitmap
);
}else{
if ( m_iPanitManagerDraw >= 0 ){
// PaintManager表示
NcDrawDefault(
dc,
m_iPanitManagerDraw
);
}else{
NcDrawDefault(
dc,
CExtPaintManager::__DCBT_EMPTY
);
}
}
}
// ----------------------------------------------------------------------------
/**
* @brief 非クライアント領域にビットマップを描画する
* @param dc [in]
*/
// ----------------------------------------------------------------------------
void CMuBarNcAreaButton::NcDrawBitMap(
CDC & dc ,
CExtBitmap * pBitmap
)
{
int nDockBtnGlyptT=0; ASSERT_VALID( this );
ASSERT( dc.GetSafeHdc() != NULL );
ASSERT( OnQueryVisibility() );
if( m_rc.IsRectEmpty() )
return;
bool bMenuTracking =
CExtPopupMenuWnd::IsMenuTracking() ? true : false;
bool bDrawActive = false; #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( !IsBarAutoHideMode( NULL, &bDrawActive ) )
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
bDrawActive = IsBarWndActive();
if( GetBar()->IsKindOf(RUNTIME_CLASS(CExtToolControlBar)) )
bDrawActive = false; CExtPaintManager::PAINTDOCKINGCAPTIONBUTTONDATA _pdcbd(
this,
m_rc,
(CExtPaintManager::e_docking_caption_button_t)nDockBtnGlyptT,
(!m_bDisabled) && m_bHover && (!bMenuTracking) && (!m_bPaintingCombinedArea),
(!m_bDisabled) && m_bPushed && (!bMenuTracking) && (!m_bPaintingCombinedArea),
(!m_bDisabled),
(!IsBarFixedMode()) || m_bPaintingCombinedArea,
bDrawActive,
IsBarFloated()
); CRect rcGlyph( _pdcbd.m_rcClient );
rcGlyph.NormalizeRect(); //-----------------------------------------------------------------------
// 選択情報描画
if( (_pdcbd.m_bHover || _pdcbd.m_bPushed)
&& _pdcbd.m_bEnabled
)
{ dc.FillSolidRect(
&rcGlyph,
//clr3dHilight
g_PaintManager->GetColor(
_pdcbd.m_bPushed
? CExtPaintManagerXP::XPCLR_HILIGHT
: CExtPaintManagerXP::CLR_3DFACE_IN
,
_pdcbd.m_pHelperSrc,
_pdcbd.m_lParam
)
);
CRect rcBtnBorder(rcGlyph);
rcBtnBorder.InflateRect(1,1);
COLORREF clrBtnBorder =
g_PaintManager->GetColor(
_pdcbd.m_bBarWndActive
? CExtPaintManagerXP::XPCLR_HILIGHT
: CExtPaintManagerXP::XPCLR_HILIGHT_BORDER
,
_pdcbd.m_pHelperSrc,
_pdcbd.m_lParam
);
dc.Draw3dRect(
rcBtnBorder,
clrBtnBorder,
clrBtnBorder
);
} pBitmap->AlphaBlend( dc.GetSafeHdc() , m_rc ); }
|
|
Technical Support
|
Feb 9, 2010 - 7:46 AM
|
You are using the code like this:
CExtBitmap * pBitmap = . . .
pBitmap->AlphaBlend( dc.GetSafeHdc() , m_rc );
But you can switch using the CExtCmdIcon -based code like this. CExtBitmap * pBitmap = . . .
CExtCmdIcon _icon;
_icon.m_bmpNormal = *pBitmap;
CExtCmdIcon::e_paint_type_t ePT = CExtCmdIcon::__PAINT_NORMAL;
_icon.Paint( g_PaintManger.GetPM(), dc.GetSafeHdc() , m_rc, ePT );
The icon supports the disabled state painting based on the currently installed paint manager. You should use the CExtCmdIcon::__PAINT_DISABLED constant.
|
|
Daniel Verret
|
Feb 3, 2010 - 12:46 PM
|
Is there a way to display a watermark in the CExtGridWnd background ? ...same thing for CExtShortCutListWnd and CExtTreeCtrl Thank you.
|
|
Technical Support
|
Feb 4, 2010 - 5:56 AM
|
You can override the CExtScrollItemWnd::OnSiwPaintBackground() virtual method and repaint the background of Prof-UIS grid control. But you can also override the CExtGridBaseWnd::OnGbwEraseArea() virtual method if you need different watermarks on different grid areas. The CExtShortcutListWnd::OnShortcutListEraseEntire() should be overridden for painting custom background of shortcut list control. The CExtTreeCtrl::OnPaintTreeItemBackground() should be overridden for painting custom background of extended tree control.
|
|
Daniel Verret
|
Feb 3, 2010 - 7:56 AM
|
It is possible to display a true color (24 bits) toolbar with CExtToolControlBar ? Right now I need to downgrade to 256 colors to be able to see my toolbar. Thank you.
|
|
Technical Support
|
Feb 4, 2010 - 1:51 PM
|
You can send us e-mail to the support mail box at this web site. But we already know what’s wrong with your BMP file. It’s not transparent. Any Photoshop version saves BMP files without alpha channel or with 255 value in each alpha value of each BMP pixel. There are three ways to load images with alpha channel into Prof-UIS based app:
1) Save PNG file in Photoshop. Open it in MSPAINT.EXE. It will display trash instead of transparent or semi-transparent pixels. This is not a problem. You should just save it as 24 bit per pixel BMP. The saved BMP file will really use 32 bit per pixel format and correct alpha values in each pixel’s data. This works only with MSPAINT.EXE provided with Windows XP and running on 24/32-bit video modes on the desktop. The MSPAINT.EXE of Windows Vista and Windows 7 save non-transparent BMP file.
2) Save PNG file in Photoshop. Use tools like Axialis Icon Workshop or other which can really save BMP file with transparency.
3) Save PNG file in Photoshop. Use PNG files in your app instead of BMP files. Prof-UIS library does not support PNG. But the ProfSkin library supports this format. The CExtBitmapSkin class in the ProfSkin library is derived from the CExtBitmap class and provides additional features like PNG format loading/saving including file system’s files, CFile / CArchive streams, binary PNG resource sections.
|
|
Technical Support
|
Feb 3, 2010 - 12:08 PM
|
None of the Visual Studio versions does allows you to specify toolbar button images based on larger than 8 bits per pixel color. You should create your toolbar resources using 8 or 4 bits per pixel bitmaps. Then you should find the toolbar’s .bmp file in the res subfolder of your project and replace it with more colored bitmap based on 15, 16, 24 or 32 bits per pixel formats. Prof-UIS will automatically use this new colored bitmap. But you will not be able to edit the toolbar in your Visual Studio. If you will need to add some new button into your high color toolbar, then you should edit it somewhere outside Visual Studio and edit toolbar resource’s text manually.
|
|
Daniel Verret
|
Feb 3, 2010 - 12:40 PM
|
What you said is exactly what I did, I replaced the .bmp in the res folder. the problem is when I run my application the toolbar button are there but invisible in 24 bits and when I use an 8 bits version of the .bmp they appear. I can click on them, they are just transparent. Now I understand that Profuis support pixel formats up to 32 bits. but do you have any idea why my 24 bits toolbar become transparent when i run my apps? By the way I know the limitation of Visual Studio about displaying and editing bitmap and icon.
|
|
Daniel Verret
|
Feb 3, 2010 - 1:02 PM
|
Ok, forget it, i just found the problems...the BMP was save in A8-R8-G8-B8 instead of R8-G8-B8...unfortunately profuis do not support an alpha channel in the bitmap.
|
|
Technical Support
|
Feb 4, 2010 - 5:55 AM
|
Prof-UIS fully supports 32-bit BMP format with alpha channel. We even can alpha blend such bitmaps when running on Windows 95. You can send us your problematic bitmap file and we will check what’s wrong. Which tool or editor did you used for creating your 32-bit BMP file?
|
|
Daniel Verret
|
Feb 4, 2010 - 10:00 AM
|
The BMP was made using photoshop. How can I send it to you? Is there a way to attached it? Or do I need to send it to you be email?
|
|
tera tera
|
Feb 2, 2010 - 9:25 PM
|
Hello. I want to deactivate this button.
Please teach a good command.
|
|
Technical Support
|
Feb 3, 2010 - 8:57 AM
|
We guess you implemented custom bar caption buttons. If the CExtBarNcAreaButton::OnQueryVisibility() virtual method returns false flag, then the button is not visible. So, your caption buttons should know when then should be visible and when hidden. The CExtControlBar::OnNcAreaButtonsReposition() method recomputes layout of caption. After that, you can redraw bar caption by sending the WM_NCPAINT message to the CExtControlBar window.
|
|
Daniel Verret
|
Feb 2, 2010 - 8:19 AM
|
In a CExtGridWnd, I want to be able to jump from a cell (CExtGridCellString) to another using the TAB key. I want to be able to add text in a cell, press tab to jump the the next cell, etc... like in excel. Is there a simple way to do that?
|
|
Technical Support
|
Feb 2, 2010 - 2:08 PM
|
The following code makes the CExtGridWnd control using the Tab key for jumping cell focus to the next grid cell at right and the Shift+Tab keys for jumping cell focus to the next grid cell on the left.
CExtGridWnd & wndGrid = . . .
wndGrid.m_dwSupportedAccelCommands |= __EGSA_IN_ROW_TAB;
|
|
Dominik Braendlin
|
Feb 2, 2010 - 6:49 AM
|
|
|
Technical Support
|
Feb 4, 2010 - 1:49 PM
|
This feature request is not implemented yet due to higher priority tasks related to release dates. We will try to include this into the nearest release this month.
|
|
Technical Support
|
Feb 4, 2010 - 1:49 PM
|
1) This feature request is not implemented yet due to higher priority tasks related to release dates. We will try to include this into the nearest release this month.
2) The __ECTN_TBB_TF_NE flag makes the text/combo field items not editable.
|
|
tera tera
|
Feb 3, 2010 - 6:35 PM
|
Dear Support,
Please tell me the time when a correction of Ribbon is completed.
|
|
Krustys Donuts
|
Feb 2, 2010 - 1:21 AM
|
I encounter an ASSERT and crash when dragging a tab window to try to dock it to another tab window, and this crash happens in Debug mode only. Sorry for the long message, as it’s a long working history. Could you take a look and see what I am doing wrong? I’m glad to provide more detailed information if you need. I’m working on an MDI application whose GUI looks in general like this: +----------------------------------------------------------+
+ File Edit View Help +
+----------------------------------------------------------+
+ + +
+ + +
+ (Tabs where + +
+ crash occurs) + +
+ + (Documents Area) +
+ + +
+ + +
+ + +
+ + +
+ + +
+-----------------------+ +
+ Tab #1 | +
+----------------------------------------------------------+
+ +
+ (Some other tabs go here) +
+ +
+----------------------------------------------------------+
+ Tab A | Tab B | Tab C | ... +
+-----------------------------------------------------------+ What I want to do is show a Tab #2(and later a Tab #3) docked in the same window as Tab #1 when the application starts up, which would look the same as Tab A, Tab B and Tab C. Tab #1, Tab A, Tab B and Tab C have their corresponding menu entries in the "View" menu. Here are the steps to reproduce the problem: Preconditions:
1). I’m working in Visual Studio Team System 2008 Development Edition.
2). I’m using Prof-UIS 2.84.
3). My CMainFrame is derived from CMDIFrameWnd directly.
4). I have my IDR_MAINFRAME menu resource, but I also define IDR_MY_DOCUMENT_MENU as an alternative menu resource to be shown when my documents are open. IDR_MY_DOCUMENT_MENU provide more menu functionalities. Step 1. Before adding any new code, run the current application. As far as I know, Prof-UIS framework would record the current GUI layout information to the registry. Step 2. Because I already have the code that does this job for Tab A, B and C, I try to follow it. Then I do:
1). In the IDR_MAINFRAME and IDR_MY_DOCUMENT_MENU resources, add a new entry in the "View" menu for "Tab #2", whose ID is ID_VIEW_TAB_2.
2). In my CMainFrame’s header file, I add a new member variable for the Tab #2’s control bar: "CTab2CtrlBar m_wndTab_2_Bar;", which is derived from CExtControlBar.
3). In CMainFrame’s message map, add an entry "ON_COMMAND_EX(ID_VIEW_TAB_2, OnBarCheck)", where OnBarCheck() is implemented as follows: BOOL CMainFrame::OnBarCheck(UINT nID)
{
//Handles the show/hide command for a control bar with its associated dialog control identifier in the frame window
return CExtControlBar::DoFrameBarCheckCmd(this, nID, true);
} 4). And an entry "ON_UPDATE_COMMAND_UI(ID_VIEW_TAB_2, OnUpdateControlBarMenu)", where the OnUpdateControlBarMenu() is implemented as follows: void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
//Performs updates for a control bar show/hide command in the frame window by using the CCmdUI object
CExtControlBar::DoFrameBarCheckUpdate(this, pCmdUI, true);
} 5). In the CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) method, add new code(shown in red) to create Tab #2 which includes:
(a). Add the "Create()" call on m_wndTab_2_Bar;
(b). Add the ID_VIEW_TAB_2 to the staticBasicCommands[] array. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// create the mdi frame window itself
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//Load the main framewindow icon
HICON hIcon = (HICON) LoadImage (g_GUIFrameworkInstance, MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON,0,0,LR_DEFAULTSIZE);
//Change from default icon to the icon we just loaded
SetIcon (hIcon, true); // Try to load shared MDI menus and accelerator tables.
m_hMDIDocumentMenu = ::LoadMenu(g_GUIFrameworkInstance, MAKEINTRESOURCE(IDR_MY_DOCUMENT_MENU));
m_hMDIDocumentAccel = ::LoadAccelerators(g_GUIFrameworkInstance, MAKEINTRESOURCE(IDR_MY_DOCUMENT_MENU));
// prof-ui -- not sure what this does yet - maybe gets registry key settings?
VERIFY( g_CmdManager->ProfileWndAdd( StaticDefs::__PROF_UIS_PROJECT_CMD_PROFILE_NAME, GetSafeHwnd()));
// For each Profile Name, ProfUIS maintains a list of all menu commands in no particular order.
// The following two lines of code populate this list.
VERIFY( g_CmdManager->UpdateFromMenu( StaticDefs::__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MAINFRAME));
VERIFY( g_CmdManager->UpdateFromMenu( StaticDefs::__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MY_DOCUMENT_MENU));
// Here goes the code to initialize other GUI components.
// Here is the code to create Tab #1. "m_wndTab1Bar" is an object of CTab1CtrlBar, derived from CExtControlBar.
m_wndTab_1_Bar.SetInitDesiredSizeVertical( CSize( 200, 400));
m_wndTab_1_Bar.SetInitDesiredSizeHorizontal( CSize( 400, 200));
if(!m_wndTab_1_Bar.Create( NULL, this, ID_VIEW_TAB_1))
{
TRACE0("Failed to create Tab #1\n");
return -1;
}
// I add the code to create Tab #2.
m_wndTab_2_Bar.SetInitDesiredSizeVertical( CSize( 200, 400));
m_wndTab_2_Bar.SetInitDesiredSizeHorizontal( CSize( 400, 200));
if(!m_wndTab_2_Bar.Create( NULL, this, ID_VIEW_TAB_2))
{
TRACE0("Failed to create Tab #2\n");
return -1;
}
// Here is the code to create Tab A, Tab B and Tab C.
// See below for the SetupDocking() implementation.
if (!SetupDocking())
return -1;
// Then set the basic commands
static UINT staticBasicCommands[] = {
ID_FILE_...,
ID_FILE_...,
ID_VIEW_TAB_1,
ID_VIEW_TAB_2, // Newly added entry
ID_VIEW_TAB_A,
ID_VIEW_TAB_B,
ID_VIEW_TAB_C,
0 // end of command list
};
VERIFY( g_CmdManager->SetBasicCommands( StaticDefs::__PROF_UIS_PROJECT_CMD_PROFILE_NAME, staticBasicCommands));
CWinApp *app = AfxGetApp();
try{
CExtControlBar::ProfileBarStateLoad( this,
app->m_pszRegistryKey, app->m_pszProfileName, app->m_pszProfileName,
&m_dataFrameWP, // m_dataFrameWP is a WINDOWPLACEMENT
true, true, HKEY_CURRENT_USER, true);
}catch(...){} // catches exceptions generated by adding / removing toolbars on new versions
// The remaining code goes here...
} bool CMainFrame::SetupDocking()
{
m_wndTab_A_Bar.EnableDocking(CBRS_ALIGN_ANY);
m_wndTab_B_Bar.EnableDocking(CBRS_ALIGN_ANY);
m_wndTab_C_Bar.EnableDocking(CBRS_ALIGN_ANY);
m_wndTab_1_Bar.EnableDocking(CBRS_ALIGN_ANY);
m_wndTab_2_Bar.EnableDocking(CBRS_ALIGN_ANY); // Newly added code - Enable the docking for Tab #2.
// Enable autohide feature for resizable control bars
if( !CExtControlBar::FrameInjectAutoHideAreas(this))
return false;
// Dock the Tab A, B and C.
m_wndTab_A_Bar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM, 1, this);
m_wndTab_A_Bar.DockControlBarIntoTabbedContainer(&m_wndTab_B_Bar, -1, this);
m_wndTab_A_Bar.DockControlBarIntoTabbedContainer(&m_wndTab_C_Bar, -1, this);
// Dock Tab #1 and Tab #2.
m_wndTab_1_Bar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM, 2, this);
m_wndTab_1_Bar.DockControlBarIntoTabbedContainer(&m_wndTab_2_Bar, -1, this); // Newly added code
return true;
} Step 3: Build and run the code above. (I guess)Because the previously stored registry information only contains the Tab #1, Tab #2 is not docked into Tab #1 when the application runs up. Therefore I click "View" -> "Tab 2" and now the Tab #2 is displayed above the Tab #1, as shown below: +------------------------------------------------------+
+ File Edit (etc.) +
+------------------------------------------------------+
+ Tab #2 + +
+-------------------+ +
+ + +
+ + +
+ + +
+-------------------+ +
+ Tab #1 + +
+-------------------+ +
+ + +
+ + +
+ + +
+------------------------------------------------------+ Step 4: Then I start dragging the caption bar of Tab #2 and try to dock it to the same window as Tab #1. Till now everything is fine, but when I release the mouse button, the following ASSERT is hit: File: ExtControlBarTabbedFeatures.cpp
Line: 247
Code:
#ifdef _DEBUG
INT nRealDockedCount = GetDockedCount();
ASSERT( nCount == nRealDockedCount ); <- Line 247
#endif // _DEBUG At this moment, the value of "nRealDockedCount" is 1, but nCount is 2. Step 5: The ASSERT in Step 4 doesn’t cause any crash. By pressing F5 the application still can run well. Step 6: According to my understanding, now the registry should store the GUI information of both Tab #1 and Tab #2. Do not delete the information. I then add Tab #3 by going through Step 2 again. Step 7: Build and run. Now Tab #1 and Tab #2 are docked together when the application runs up. Tab #3 is not shown. Click "View"->"Tab 3". Tab #3 is displayed above the Tab #1 and Tab #2. Step 8: Press down the left mouse button and start dragging the Tab #3. During the drag, the docking markers are shown to let you select where you want to dock Tab #3, and I try to move to the center of the docking marker which can dock Tab #3 to the same tab container of Tab #1 and #2. However, as soon as the mouse pointer is moved to the docking marker center(WITHOUT releasing the mouse button), a breakpoint is triggered: File: dbgrptt.c
Line: 89
Code:
_CRTIMP void _cdecl _CrtDbgBreak(
void
)
{
DebugBreak();
} <- Line 89 The call stack at this momenet provides little information: ntdll.dll!7c92120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> msvcr90d.dll!_CrtDbgBreak() Line 89 C Step 9: I press F5 to continue the execution, and the same ASSERT as in Step 4 is hit again: File: ExtControlBarTabbedFeatures.cpp
Line: 247
Code:
#ifdef _DEBUG
INT nRealDockedCount = GetDockedCount();
ASSERT( nCount == nRealDockedCount ); <- Line 247
#endif // _DEBUG At this moment, the nRealDockedCount is still 1 while the nCount is 3. The call stack is: > ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x1b bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=true) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingStop(bool bCancel=false) Line 12779 C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9713 + 0x14 bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++ Step 10: Press F5 to continue,and the DebugBreak() breakpoint and the ASSERT will be triggered repeatedly(about twice), and finally the following ASSERT fails: File: afxwin2.inl
Line: 49
Code:
_AFXWIN_INLINE BOOL CWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
{ ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd, message, wParam, lParam); } where the m_hWnd is 0xfeeefeee, an obvious bad window handle. Call stack at this moment:
> mfc90d.dll!CWnd::PostMessageA(unsigned int message=133, unsigned int wParam=0, long lParam=0) Line 49 + 0x2a bytes C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9723 C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x00140c1e, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++ Step 11: Press F5 to continue, and this time an "Access violation reading location" occurs in CWnd::Default(): File: wincore.cpp
Line: 273
Code:
LRESULT CWnd::Default()
{
// call DefWindowProc with the last message
_AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();
return DefWindowProc(pThreadState->m_lastSentMsg.message,
pThreadState->m_lastSentMsg.wParam, pThreadState->m_lastSentMsg.lParam); <- Line 273
} Call stack:
> mfc90d.dll!CWnd::Default() Line 273 + 0x1d bytes C++
mfc90d.dll!CWnd::OnCompositionChanged() Line 370 + 0x11 bytes C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9727 C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x00140c1e, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++ From now on the application cannot continue any more. That’s all I have so far.
|
|
Technical Support
|
Feb 2, 2010 - 2:07 PM
|
Please check the following:
1) Your CMainFrame::OnBarCheck() method invokes the CExtControlBar::DoFrameBarCheckCmd(this, nID, true); code where the third true parameter means the resizable bar show/hide commands should work like toolbar commands. This check box like command style can be used with resizable bars, but it’s not compatible with auto-hiding feature. Please check the auto-hiding feature is disabled in your app. I.e. the CExtControlBar::FrameInjectAutoHideAreas() method is not invoked. This method is invoked in the CMainFrame::SetupDocking() method. This is incorrect. You should choose what’s more important for you: auto-hiding or check like commands for resizable bars.
2) All the control bars must use the unique dialog control identifiers. This is very important. All the toolbars, status bar, menu bar, resizable bars must have an unique identifiers specified in parameters of their Create() methods.
We also need the following:
1) The complete stack listing at a crash time:
2) It would be very useful to take a look at entire source code of your main frame class. You can send it via e-mail.
|
|
Krustys Donuts
|
Feb 3, 2010 - 4:05 AM
|
I removed the method call to "CExtControlBar::FrameInjectAutoHideAreas()" but unfortunately the crash doesn’t go away. I also checked the controls’ IDs and they are unique. I’ll check and see if I can send the code to you. As you required, here is the information of the call stacks at crash time(I used my original code to retrieve the following information): 1). At the crash time(very poor call stack information): File: dbgrptt.c
Line: 89
Code:
_CRTIMP void _cdecl _CrtDbgBreak(
void
)
{
DebugBreak();
} Full Call Stack:
ntdll.dll!7c92120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> msvcr90d.dll!_CrtDbgBreak() Line 89 C 2). Then hit F5 to continue the execution, and a second breakpoint would be triggered("MyApp.exe" is my application): File: ExtControlBarTabbedFeatures.cpp
Line: 247
Code:
#ifdef _DEBUG
INT nRealDockedCount = GetDockedCount();
ASSERT( nCount == nRealDockedCount );
#endif // _DEBUG Full Call Stack:
> ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x1b bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=true) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingStop(bool bCancel=false) Line 12779 C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9713 + 0x14 bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!77d18816()
user32.dll!77d28ea0()
user32.dll!77d28eec()
ntdll.dll!7c92e473()
user32.dll!77d194be()
user32.dll!77d2c174()
user32.dll!77d48a8d()
user32.dll!77d3a2bc()
ntdll.dll!7c930435()
ntdll.dll!7c930385()
ntdll.dll!7c937e09()
user32.dll!77d50877()
user32.dll!77d5082f()
user32.dll!77d2c2e8()
user32.dll!77d19195()
msvcr90d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x03a74f54, const char * szLine=0x0012b3c0, const char * szModule=0x00000000, const char * szUserMessage=0x0012a3c0) Line 363 + 0x16 bytes C
msvcr90d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 420 + 0x28 bytes C
msvcr90d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 241 + 0x1d bytes C
msvcr90d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 258 + 0x1d bytes C
mfc90d.dll!AfxAssertFailedLine(const char * lpszFileName=0x03a74f54, int nLine=247) Line 25 + 0x14 bytes C++
ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x17 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=false) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingUpdateState(const CPoint & point={...}, bool bForceFloatMode=false) Line 12961 C++
ProfUIS284md.dll!CExtControlBar::_OnMouseMoveMsg(unsigned int nFlags=1, CPoint point={...}) Line 9763 + 0x2b bytes C++
ProfUIS284md.dll!CExtControlBar::_DraggingStart(const CPoint & point={...}, const CPoint & pointOffset={...}, CSize sizeWaitMouseMove={...}) Line 12636 + 0x24 bytes C++
ProfUIS284md.dll!CExtControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 10123 + 0x2d bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=-917408, long * pResult=0x0012f9e0) Line 2183 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
user32.dll!77d18816()
user32.dll!77d189cd()
user32.dll!77d196c7()
mfc90d.dll!AfxInternalPumpMessage() Line 183 C++
mfc90d.dll!CWinThread::PumpMessage() Line 900 C++
mfc90d.dll!CWinThread::Run() Line 629 + 0xd bytes C++
mfc90d.dll!CWinApp::Run() Line 865 C++
mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 47 + 0xd bytes C++
MyApp.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 34 C++
MyApp.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
MyApp.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c817077()
MyApp.exe!std::vector<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> >::_Insert_n(std::_Vector_const_iterator<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> > _Where={_ModuleName={...} _ModuleDescription={...} }, unsigned int _Count=3435973836, const ObjectInstanceXMLMarshaller::ModuleObjectDescription & _Val={...}) Line 1198 C++
cccccccc() 3). Hit F5 again to continue, and we go back to the dbgrptt.c: File: dbgrptt.c
Line: 89
Code:
_CRTIMP void _cdecl _CrtDbgBreak(
void
)
{
DebugBreak();
} Full Call Stack:
ntdll.dll!7c92120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> msvcr90d.dll!_CrtDbgBreak() Line 89 C 4). Hit F5. Go back to the ExtControlBarTabbedFeatures.cpp File: ExtControlBarTabbedFeatures.cpp
Line: 247
Code:
#ifdef _DEBUG
INT nRealDockedCount = GetDockedCount();
ASSERT( nCount == nRealDockedCount );
#endif // _DEBUG Full Call Stack:
ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x1b bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertBarImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1530 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertBar(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1479 C++
ProfUIS284md.dll!CExtControlBar::DockControlBarIntoTabbedContainer(CExtControlBar * pBar=0x0f26a7c0, int nIndex=0, CFrameWnd * pDockSite=0x0f1eb980, bool bRecalcLayout=true) Line 19974 C++
ProfUIS284md.dll!CExtControlBar::_DraggingApplyState(CExtControlBar::InternalDraggingState_t & _ds={...}, bool bFinalApply=true) Line 18508 + 0x23 bytes C++
ProfUIS284md.dll!CExtControlBar::_DraggingStop(bool bCancel=false) Line 12786 + 0x19 bytes C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9713 + 0x14 bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!77d18816()
user32.dll!77d28ea0()
user32.dll!77d28eec()
ntdll.dll!7c92e473()
user32.dll!77d194be()
user32.dll!77d2c174()
user32.dll!77d48a8d()
user32.dll!77d3a2bc()
ntdll.dll!7c930435()
ntdll.dll!7c930385()
ntdll.dll!7c937e09()
user32.dll!77d50877()
user32.dll!77d5082f()
user32.dll!77d2c2e8()
user32.dll!77d19195()
msvcr90d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x03a74f54, const char * szLine=0x0012b3c0, const char * szModule=0x00000000, const char * szUserMessage=0x0012a3c0) Line 363 + 0x16 bytes C
msvcr90d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 420 + 0x28 bytes C
msvcr90d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 241 + 0x1d bytes C
msvcr90d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 258 + 0x1d bytes C
mfc90d.dll!AfxAssertFailedLine(const char * lpszFileName=0x03a74f54, int nLine=247) Line 25 + 0x14 bytes C++
ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x17 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=false) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingUpdateState(const CPoint & point={...}, bool bForceFloatMode=false) Line 12961 C++
ProfUIS284md.dll!CExtControlBar::_OnMouseMoveMsg(unsigned int nFlags=1, CPoint point={...}) Line 9763 + 0x2b bytes C++
ProfUIS284md.dll!CExtControlBar::_DraggingStart(const CPoint & point={...}, const CPoint & pointOffset={...}, CSize sizeWaitMouseMove={...}) Line 12636 + 0x24 bytes C++
ProfUIS284md.dll!CExtControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 10123 + 0x2d bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=-917408, long * pResult=0x0012f9e0) Line 2183 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
user32.dll!77d18816()
user32.dll!77d189cd()
user32.dll!77d196c7()
mfc90d.dll!AfxInternalPumpMessage() Line 183 C++
mfc90d.dll!CWinThread::PumpMessage() Line 900 C++
mfc90d.dll!CWinThread::Run() Line 629 + 0xd bytes C++
mfc90d.dll!CWinApp::Run() Line 865 C++
mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 47 + 0xd bytes C++
MyApp.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 34 C++
MyApp.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
MyApp.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c817077()
> MyApp.exe!std::vector<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> >::_Insert_n(std::_Vector_const_iterator<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> > _Where={_ModuleName={...} _ModuleDescription={...} }, unsigned int _Count=3435973836, const ObjectInstanceXMLMarshaller::ModuleObjectDescription & _Val={...}) Line 1198 C++
cccccccc() 5). Hit F5 again. An ASSERT fails in afxwin2.inl. From the "Watch" window I can see the m_hWnd is a bad window handle which triggers the ASSERT. I’m wondering how the window becomes invalid.. File: afxwin2.inl
Line: 49
Code:
_AFXWIN_INLINE BOOL CWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
{ ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd, message, wParam, lParam); } Full Call Stack:
> mfc90d.dll!CWnd::PostMessageA(unsigned int message=133, unsigned int wParam=0, long lParam=0) Line 49 + 0x2a bytes C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9723 C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!77d18816()
user32.dll!77d28ea0()
user32.dll!77d28eec()
ntdll.dll!7c92e473()
user32.dll!77d194be()
user32.dll!77d2c174()
user32.dll!77d48a8d()
user32.dll!77d3a2bc()
ntdll.dll!7c930435()
ntdll.dll!7c930385()
ntdll.dll!7c937e09()
user32.dll!77d50877()
user32.dll!77d5082f()
user32.dll!77d2c2e8()
user32.dll!77d19195()
msvcr90d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x03a74f54, const char * szLine=0x0012b3c0, const char * szModule=0x00000000, const char * szUserMessage=0x0012a3c0) Line 363 + 0x16 bytes C
msvcr90d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 420 + 0x28 bytes C
msvcr90d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 241 + 0x1d bytes C
msvcr90d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 258 + 0x1d bytes C
mfc90d.dll!AfxAssertFailedLine(const char * lpszFileName=0x03a74f54, int nLine=247) Line 25 + 0x14 bytes C++
ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x17 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=false) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingUpdateState(const CPoint & point={...}, bool bForceFloatMode=false) Line 12961 C++
ProfUIS284md.dll!CExtControlBar::_OnMouseMoveMsg(unsigned int nFlags=1, CPoint point={...}) Line 9763 + 0x2b bytes C++
ProfUIS284md.dll!CExtControlBar::_DraggingStart(const CPoint & point={...}, const CPoint & pointOffset={...}, CSize sizeWaitMouseMove={...}) Line 12636 + 0x24 bytes C++
ProfUIS284md.dll!CExtControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 10123 + 0x2d bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=-917408, long * pResult=0x0012f9e0) Line 2183 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
user32.dll!77d18816()
user32.dll!77d189cd()
user32.dll!77d196c7()
mfc90d.dll!AfxInternalPumpMessage() Line 183 C++
mfc90d.dll!CWinThread::PumpMessage() Line 900 C++
mfc90d.dll!CWinThread::Run() Line 629 + 0xd bytes C++
mfc90d.dll!CWinApp::Run() Line 865 C++
mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 47 + 0xd bytes C++
MyApp.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 34 C++
MyApp.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
MyApp.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c817077()
MyApp.exe!std::vector<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> >::_Insert_n(std::_Vector_const_iterator<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> > _Where={_ModuleName={...} _ModuleDescription={...} }, unsigned int _Count=3435973836, const ObjectInstanceXMLMarshaller::ModuleObjectDescription & _Val={...}) Line 1198 C++
cccccccc() 6). Hit F5. File: wincore.cpp
Line: 273
Code:
LRESULT CWnd::Default()
{
// call DefWindowProc with the last message
_AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();
return DefWindowProc(pThreadState->m_lastSentMsg.message,
pThreadState->m_lastSentMsg.wParam, pThreadState->m_lastSentMsg.lParam);
} Full Call Stack:
> mfc90d.dll!CWnd::Default() Line 273 + 0x1d bytes C++
mfc90d.dll!CWnd::OnCompositionChanged() Line 370 + 0x11 bytes C++
ProfUIS284md.dll!CExtControlBar::OnCancelMode() Line 9727 C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=31, unsigned int wParam=0, long lParam=0, long * pResult=0x00128744) Line 2042 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!77d18816()
user32.dll!77d28ea0()
user32.dll!77d28eec()
ntdll.dll!7c92e473()
user32.dll!77d194be()
user32.dll!77d2c174()
user32.dll!77d48a8d()
user32.dll!77d3a2bc()
ntdll.dll!7c930435()
ntdll.dll!7c930385()
ntdll.dll!7c937e09()
user32.dll!77d50877()
user32.dll!77d5082f()
user32.dll!77d2c2e8()
user32.dll!77d19195()
msvcr90d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x03a74f54, const char * szLine=0x0012b3c0, const char * szModule=0x00000000, const char * szUserMessage=0x0012a3c0) Line 363 + 0x16 bytes C
msvcr90d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 420 + 0x28 bytes C
msvcr90d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f454) Line 241 + 0x1d bytes C
msvcr90d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x03a74f54, int nLine=247, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 258 + 0x1d bytes C
mfc90d.dll!AfxAssertFailedLine(const char * lpszFileName=0x03a74f54, int nLine=247) Line 25 + 0x14 bytes C++
ProfUIS284md.dll!CExtDockDynTabBar::CalcOrderedVector(CArray<CExtControlBar *,CExtControlBar *> & vBars={...}) Line 247 + 0x17 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::_InsertTemporaryItemsFromImpl(CExtControlBar * pBar=0x0f26a7c0, long & nIndex=0) Line 1431 + 0x16 bytes C++
ProfUIS284md.dll!CExtDynTabControlBar::InsertTemporaryItemsFrom(CExtControlBar * pBar=0x0f26a7c0, long nIndex=0, bool bUpdateTabWnd=false) Line 1406 C++
ProfUIS284md.dll!CExtControlBar::InternalDraggingState_t::DrawState(bool bErasingPrevious=false) Line 15395 C++
ProfUIS284md.dll!CExtControlBar::_DraggingUpdateState(const CPoint & point={...}, bool bForceFloatMode=false) Line 12961 C++
ProfUIS284md.dll!CExtControlBar::_OnMouseMoveMsg(unsigned int nFlags=1, CPoint point={...}) Line 9763 + 0x2b bytes C++
ProfUIS284md.dll!CExtControlBar::_DraggingStart(const CPoint & point={...}, const CPoint & pointOffset={...}, CSize sizeWaitMouseMove={...}) Line 12636 + 0x24 bytes C++
ProfUIS284md.dll!CExtControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 10123 + 0x2d bytes C++
mfc90d.dll!CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=-917408, long * pResult=0x0012f9e0) Line 2183 C++
mfc90d.dll!CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 1755 + 0x20 bytes C++
mfc90d.dll!CControlBar::WindowProc(unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 506 + 0x14 bytes C++
ProfUIS284md.dll!CExtControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 8622 C++
ProfUIS284md.dll!CExtDynControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=-917408) Line 4741 + 0x14 bytes C++
mfc90d.dll!AfxCallWndProc(CWnd * pWnd=0x0f26a7c0, HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 240 + 0x1c bytes C++
mfc90d.dll!AfxWndProc(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 403 C++
mfc90d.dll!AfxWndProcBase(HWND__ * hWnd=0x0040092c, unsigned int nMsg=513, unsigned int wParam=1, long lParam=-917408) Line 441 + 0x15 bytes C++
user32.dll!77d18734()
user32.dll!77d18816()
user32.dll!77d189cd()
user32.dll!77d196c7()
mfc90d.dll!AfxInternalPumpMessage() Line 183 C++
mfc90d.dll!CWinThread::PumpMessage() Line 900 C++
mfc90d.dll!CWinThread::Run() Line 629 + 0xd bytes C++
mfc90d.dll!CWinApp::Run() Line 865 C++
mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 47 + 0xd bytes C++
MyApp.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f40, int nCmdShow=1) Line 34 C++
MyApp.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
MyApp.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c817077()
MyApp.exe!std::vector<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> >::_Insert_n(std::_Vector_const_iterator<ObjectInstanceXMLMarshaller::ModuleObjectDescription,std::allocator<ObjectInstanceXMLMarshaller::ModuleObjectDescription> > _Where={_ModuleName={...} _ModuleDescription={...} }, unsigned int _Count=3435973836, const ObjectInstanceXMLMarshaller::ModuleObjectDescription & _Val={...}) Line 1198 C++
cccccccc() 7). Hit F5, and we will get the same information as Step 6 repeatedly.
|
|
Technical Support
|
Feb 3, 2010 - 12:11 PM
|
Very unfortunately, the call stack listing hasn’t helped us. Could you send us the UI related source code? We need the main frame’s source code first of all. We can also connect to your desktop remotely and clarify what’s wrong.
|
|
Krustys Donuts
|
Feb 2, 2010 - 1:35 AM
|
I forgot to mention that I have already studied the "MDI" project in the "Samples" folder, to see how the tabs are created and docked. I don’t think this "MDI" project and my project have any difference on the main working flow but "MDI" works very well while mine crashes... Am I missing some important details??
|
|
Cameron
|
Feb 1, 2010 - 3:04 PM
|
hello, i am using Prof-UIS 2.88 with visual studio 6.0. i have CExtEdit controls created on both dialog templates and dynamically created within a CExtNCSB< CExtWS < CScrollView > >, both with the WS_BORDER style. the CExtEdit controls on the dialog templates have a theme-colored border, while the dynamically created CExtEdit controls have a plain black border. any ideas as to why this might be happening? thanks in advance for any help you can provide. regards, cameron
|
|
Technical Support
|
Feb 2, 2010 - 2:12 PM
|
We suspect you created an edit control with zero non-client area. This is why the CExtEdit class is unable to draw borders. Please use the dynamic editor creation code like this:
CRect rcEdit( . . . );
UINT nEditID = . . .
CExtEdit * pEdit = new CExtEdit;
VERIFY( pEdit->Create( WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, rcEdit, this, nEditID ) );
pEdit->SetFont( CFont::FromHandle( (HFONT)::GetStockObject(DEFAULT_GUI_FONT) ) );
pEdit->ModifyStyleEx( 0, WS_EX_CLIENTEDGE, SWP_FRAMECHANGED );
The last line is important. It reserves non-client area space.
|
|
Cameron
|
Feb 1, 2010 - 12:24 PM
|
hello, i have an existing Visual Studio 6.0 project that uses CScrollView and am migrating it to Prof-UIS, but when i drop in CExtNCSB<CScrollView> to replace CScrollView, as in the FormEditor example, i now get an assert at startup in AfxHookWindowCreate at the line:
ASSERT(pThreadState->m_pWndInit == NULL); // hook not already in progress
i have reproduced this in a simple MFC program using the MFC application wizard and replacing CView with CExtNCSB<CScrollView>, and changing nothing else from the wizard-generated code. any ideas what i am doing wrong? thanks in advance for your help! regards, cameron
|
|
Cameron
|
Feb 1, 2010 - 1:14 PM
|
that did it, thanks for the quick response! cameron
|
|
Technical Support
|
Feb 1, 2010 - 12:44 PM
|
You come across the MFC’s window creation hooking mechanism. It does not allow creating windows until the current window creation event is finally handled. The CExtNCSB template class may require delayed scroll bar initialization mode in such particular cases because it creates two scroll bar windows and corner area window between scroll bars. This means your scrollable view window should invoke the parent class constructor explicitly. Please take a closer look at the CFormEditorView class constructor source code in the FormEditor sample application:
CFormEditorView::CFormEditorView()
: CExtNCSB < CScrollView > ( true )
, m_sizeGridStep( 8, 8 )
, m_sizeDropArea( 100, 25 )
, m_rcLastDropArea( 0, 0, 0, 0 )
, m_dwTrackingCreation( __IMG_TOOLBOX_POINTER )
, m_bTrackingCreation( false )
, m_bCanceling( false )
, m_rcTrackingCreation( 0, 0, 0, 0 )
, m_hWndSizeCursorHitTest( NULL )
, m_nSizeCursorHitTest( -1 )
, m_bSizingControl( false )
, m_bGroupMoving( false )
, m_ptMoveCurr( -1, -1 )
, m_bTabOrderMode( false )
, m_nTabClickNo( 0 )
{
VERIFY( RegisterFormEditorWndClass() );
}
The following line is what you need: : CExtNCSB < CScrollView > ( true )
This is the explicit invocation of the CExtNCSB template class constructor and it contains the true parameter flag indicating that scroll bars and corner area window should be created with a delay.
|
|
Offer Har
|
Jan 31, 2010 - 11:47 PM
|
Dear Support, I would like to add Undo & Redo buttons like in visual studio - with a drop list and an automatic selection on hover. Is it possible in Prof-UIS? Do you have any sample? Thanks, Ron.
|
|
Technical Support
|
Feb 1, 2010 - 4:59 AM
|
The CExtBarUndoRedoButton toolbar button implements an undo-redo button exactly like your described. It’s well integrated with the Prof-UIS customization subsystem for toolbars and menus (CExtCustomizeSite ) and with ribbon controls (CExtRibbonBar , CExtRibbonPage ). The BitmapEditor demonstrates how to use undo-redo buttons.
|
|
Offer Har
|
Feb 1, 2010 - 11:59 PM
|
Dear Support, I tried to follow the example in the bitmap editor, however I only need the undo/redo and not all the customization found there, so I narrowed it to this piece of code I added in OnCreate , but nothing happened to the button in my toolbar: CWinApp* pApp = ::AfxGetApp();
g_CmdManager->ProfileSetup(pApp->m_pszProfileName, GetSafeHwnd());
g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_MAINFRAME);
g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName, IDR_TOOLBAR_EDIT_BIG);
CExtCmdItem* pCmdItem = g_CmdManager->CmdGetPtr(pApp->m_pszProfileName, ID_EDIT_UNDO );
pCmdItem->m_nLParamUserData = (LPARAM)pCmdItem->m_nCmdID;
pCmdItem->StateSetUndoRedo();
pCmdItem->StateSetSeparatedDD(); What other minimal steps I need to take to have the undo-redo? I’m still before adding the content to the drop-down, just to see the arrow next to the button, and for it to drop the drop-down... Thanks, Ron
|
|
Technical Support
|
Feb 2, 2010 - 2:11 PM
|
The BitmapEditor sample application demonstrates the CExtImageEditWnd control features. It performs image editing and supports undo-redo. The sample app uses customizable toolbars and menus and we made the ID_EDIT_UNDO and ID_EDIT_REDO commands in toolbars and menus working like undo-redo popup list boxes. The following part of the CMainFrame::OnCreate() method just marks these commands as list boxes:
CExtCmdItem * pCmdItem =
g_CmdManager->CmdGetPtr( pApp->m_pszProfileName, ID_EDIT_UNDO );
ASSERT( pCmdItem != NULL );
pCmdItem->m_nLParamUserData = (LPARAM)pCmdItem->m_nCmdID;
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
pCmdItem->StateSetUndoRedo();
pCmdItem->StateSetSeparatedDD();
#endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
pCmdItem =
g_CmdManager->CmdGetPtr( pApp->m_pszProfileName, ID_EDIT_REDO );
ASSERT( pCmdItem != NULL );
pCmdItem->m_nLParamUserData = (LPARAM)pCmdItem->m_nCmdID;
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
pCmdItem->StateSetUndoRedo();
pCmdItem->StateSetSeparatedDD();
#endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
The following virtual methods are initializing list box content, measuring popup list box size, handling the item selection and provide list box caption: CMainFrame::OnPopupListBoxInitContent()
CMainFrame::OnPopupListBoxMeasureTrackSize()
CMainFrame::OnPopupListBoxSelEndOK()
CMainFrame::OnPopupUndoRedoFormatCaption()
You should implement the same methods in your project.
|
|
Robert Webb
|
Jan 26, 2010 - 7:44 PM
|
Hi, Using ProfUIS customization, user may edit icons for existing commands (on toolbars or menus). However, they are limited to the colour palette of the original image. Eg, if the icon only required 2 colours, then they are limited to only those two colours if they wish to edit the icon. This is very limiting. Even worse, if they wish to add an icon to a command that doesn’t have an icon by default, then they are stuck. It can’t be done, from what I can see. For example, many menu commands may not have an icon, and we also add commands on the fly which have no icon. Our users need to be able to add and edit icons for these. How can we achieve this? I tried adding a blank place-holder icon for every command, but again we have the above problem, where the icon only has one or two colours and can’t be edited very effectively. But also the blank icon is then used in menus instead of a tick. So instead of a tick or no tick, there is always just the blank image, either highlighted or not. Why shouldn’t the user always be able to add and edit icons with 24-bit colour? Is there no way to make this possible? Thanks, Rob.
|
|
Technical Support
|
Feb 2, 2010 - 2:07 PM
|
Thank you for your comments. Here is the complete new set of new CExtColorPaletteWnd control styles:
// use color picker dialog for picking color on left/right mouse button clicks
// these two styles work only if the __ECPWS_PICK_ACTIVE_COLOR_HT is not specified
#define __ECPWS_PICK_ACTIVE_COLOR_LMB 0x00000080L
#define __ECPWS_PICK_ACTIVE_COLOR_RMB 0x00000100L
// use color picker dialog for picking color on left mouse button click over
// active colors
#define __ECPWS_PICK_ACTIVE_COLOR_HT 0x00000200L
// the __ECPWS_PICK_ACTIVE_COLOR_LMB, __ECPWS_PICK_ACTIVE_COLOR_RMB and __ECPWS_PICK_ACTIVE_COLOR_HT styles
// should add the picker color to displayed palette
#define __ECPWS_PICK_ACTIVE_COLOR_MODIFY_PALETTE 0x00000400L
The CExtIconEditDlg dialog uses the color palette with the styles by __ECPWS_PICK_ACTIVE_COLOR_HT|__ECPWS_PICK_ACTIVE_COLOR_MODIFY_PALETTE default. So, you don’t need to do anything but downloading the latest source code again.
|
|
Robert Webb
|
Feb 5, 2010 - 12:10 AM
|
It works great! Thanks, Rob.
|
|
Technical Support
|
Jan 27, 2010 - 1:08 PM
|
We added a new CExtCustomizeSite::m_bEnableIconOptionsForIconlessCommands flag property in Prof-UIS 2.89. It allows you to assign icons to icon-less commands in the customize mode. You can drop us an e-mail to the support mail box at this web site so we will provide you with the source code update. The image editor allows you to work with 24 bit color images only. The 32 bit color images are not supported at this moment. This image editor is not an Adobe Photoshop. But if you have a 32 bit image, then you can paste it in the customize mode.
|
|
Robert Webb
|
Jan 31, 2010 - 8:57 PM
|
Thanks. It wasn’t in the one I downloaded after you sent me the link, but it is there now in a newer version since then. It works, allowing the user to provide images for commands that didn’t have one to start with. Great! However, although 24-bit images are supported, the user is limited to a palette of the colours that are already there to begin with. In the case of a new image, this is only 2 or 3! I can’t find any way to use a new colour or to change the colour of those colours already in the palette. There’s a work around though: create the image elsewhere and copy/paste it into the editor. At first the palette doesn’t update and still only 2 or 3 colours may be available, but the palette refills if you close and reopen the editor. Still, it really needs a way to choose a colour for drawing with. I’m not asking for Photoshop, but it’s next to useless if you can only draw new images in black and white. I’d suggest that when the current foreground or background colour is clicked on, it opens a colour chooser. Thanks, Rob.
|
|
Technical Support
|
Feb 1, 2010 - 11:51 AM
|
We agree with your suggestion. We added new __ECPWS_PICK_ACTIVE_COLOR_LMB and __ECPWS_PICK_ACTIVE_COLOR_RMB styles used by the CExtColorPaletteWnd control. They allow you to pick custom colors on left/right mouse button clicks over active colors area.
|
|
Robert Webb
|
Feb 1, 2010 - 4:55 PM
|
Thanks, I haven’t tried it yet, but rather than left-click for foreground colour and right-click for background colour, wouldn’t it be more intuitive to left-click on either the foreground colour indicator or the background colour indicator to change the relevant colour? That’s how other packages like PaintShopPro do it. It’s more intuitive to click on the thing you want to change. Oh, and it looks like your overnight build is labelled incorrectly. 2010-02-21. It’s not the 21st of Feb yet :-) Thanks, Rob.
|
|
Robert Webb
|
Feb 1, 2010 - 5:16 PM
|
Oh, and this is probably a silly question, but where do I set those new styles? The icon editor is created in Prof-UIS’s customization code, not by me, so where do I set the styles? If you use my suggestion of clicking on the indicator for the colour you want to change (ie one of the two small overlapping squares in the top right corner of the icon editor) then I can’t see why this functionality would need to be optional anyway. Thanks, Rob.
|
|
Lars Mohr
|
Jan 25, 2010 - 4:14 AM
|
Hello Support-Team, I have a question concerning the CExtShellDialogFile class. Why is there a scan on floppy disk if I select the item "My Computer"? And if the last open file was over the network and I restart the programm again and open the dialog it will take up to 5 minutes to open the dialog. Regards.
|
|
Technical Support
|
Feb 8, 2010 - 12:56 PM
|
No, we are trying to re-design shell classes and make them 100% thread independent. You know, most of MFC classes (all the CObject -derived) must be used only in one thread where they are created. Besides, each PIDL in one thread will need to create a cloned copy of it for providing to other thread. This requires serious changes in shell classes.
|
|
Lars Mohr
|
Jan 25, 2010 - 3:52 PM
|
About the scan of A:\ and B:\ drives does not disturb me but the long delay if the dialog has opend a network file before (after restart) is a big problem for me because our customer means the program is hunging up (no response message from MS). Is there a chance to disable the scanning of all sublevel in a network? I think this would reduce the delay. But I agree to you this is only by restart the program and if the last access was a network folder or file.
|
|
Technical Support
|
Jan 25, 2010 - 1:54 PM
|
The shell controls use the standard shell APIs for scanning the shell tree. We just traversing through shell items and querying their properties. We do not perform any tricks. The Windows Explorer and common file dialog definitively use some tricks. We suspect they do not query any properties of A:\ and B:\ drives. We suspect they scan only one item in each sub-folder level (network or local) before scanning other folders on each sublevel in a background thread. The current version of Prof-UIS shell controls uses some basic and simple shell access algorithms without any tricks and multithreading. The performance of scanning A:\ and network paths is really different in each particular case on different computers. It can be fast. It’s not always slow. It’s typically enough close to Windows shell. Some network path can be opened slow in the Prof-UIS shell file dialog. But the same network path is typically opened fast when you invoke the same file dialog for the second time and without restarting your application. Such surprises can be avoided only by pre-scanning the shell tree in the background. We also suspect Windows Explorer does such trick. We can experimentally put some Windows Explorer like tricks into Prof-UIS shell controls, but this may change class APIs and make them more difficult to use.
|
|
Lars Mohr
|
Feb 5, 2010 - 4:26 AM
|
Are there already results?
|
|
Stephan Wieland
|
Jan 21, 2010 - 2:17 AM
|
Hello, I´ve installed VisualStudio 2005 and Prof-UIS 2.88 In one project I can include the library and ProfUIS288smd.lib is linked and in another project there´s "Automatically linking with Prof-UIS library: ProfUIS283smd.lib" (2.83!!!) but I don´t have 2.83 installed. Can you please help me? Where´s the problem? SW
|
|
Stephan Wieland
|
Jan 22, 2010 - 12:10 AM
|
Dear Support Team, thanks for your support, because of your hints, I found the problem... I really tried the 2.83 before (not installed it) but in the project there was the old ExtMfcDef.h Thanks a lot SW
|
|
Technical Support
|
Jan 21, 2010 - 12:09 PM
|
The Automatically linking with... text appears in the Visual Studio’s Output window because the .../Prof-UIS/Include/ExtMfcDef.h file contains the following line of code:
#pragma message(" Automatically linking with Prof-UIS library: " __PROF_UIS_LIB_NAME )
The __PROF_UIS_LIB_NAME preprocessor variable is defined in the same file and it can be ProfUIS283smd.lib only if you are using header files of Prof-UIS 2.83. This means one of the following: 1) You didn’t really installed 2.88 and still using 2.83 2) You have both 2.83 and 2.88 on your computer. The Visual Studio is configured to see header files of 2.83. Please check the include folders list in your Visual Studio settings. The library folders list, of course, should also be checked.
|
|
Dominik Braendlin
|
Jan 20, 2010 - 6:38 AM
|
Dear Tech Support, We are planning to develop an application which will use the ribbon bar concept. After playing around with the RibbonBarMDI example (PROF-UIS 2.88) it really felt very dull even in release mode. Experience with other component manufacturer showed that it is possible to have a quick responding ribbon bar implementation on the same computer as we have tested the Prof-UIS example. Is there a way to improve performance? Unfortunately the performance as is will not be accepted by our customers. Regards, Adrian
|
|
Technical Support
|
Jan 22, 2010 - 1:20 PM
|
We have main tasks and additional tasks. We need to release new Visual Studio 2010 UI theme, Windows 7 ribbon skin and HTML support. These tasks are main. This is our work for several nearest month and two nearest Prof-UIS releases. The improved ribbon bar layout algorithm should appear in one of these releases.
|
|
Dominik Braendlin
|
Jan 21, 2010 - 7:21 AM
|
Can you give me a rough estimate how long the improvment will take? Are we talking weeks, months? Thanks, Adrian
|
|
Technical Support
|
Jan 20, 2010 - 1:31 PM
|
The ribbon bar performance requires improvement. We confirm this. But this is related only for ribbon tab pages containing tool groups and/or ribbon galleries like the Home tab page in the RibbonBarMDI sample application. We are working on this.
|
|
tera tera
|
Jan 19, 2010 - 5:24 PM
|
Hello. A user pushes the X button very much by mistake.
A method the user chooses a docking bar among PopupMenu, and to display again.
Users do not seem to understand it well. In CExtContorlBar, I want to always make X buttons non-display.
Please teach a method.
|
|
Technical Support
|
Jan 20, 2010 - 1:31 PM
|
Please create and use your own CExtControlBar derived class which implements the CExtControlBar::OnNcAreaButtonsReinitialize() virtual method. Your virtual method should be similar to original, but it should not create the CExtBarNcAreaButtonClose button. This will remove the close buttons from all the stand-alone resizable control bars. The tabbed bars are also resizable control bars. You should implement your own tabbed bar class, override the same virtual method in it and make Prof-UIS using your tabbed bar class. Here is what you need in details:
http://www.prof-uis.com/prof-uis/tech-support/faq/control-bars.aspx#how-to-remove-the-close-button-x-from-the-control-bar
|
|
tera tera
|
Jan 19, 2010 - 1:55 AM
|
Hello. It is hope about QuickAccessBar.
I put a bar aside and cannot display it?
|
|
Technical Support
|
Jan 19, 2010 - 1:12 PM
|
The quick access toolbar is a built-in part of ribbon bar. It’s not a standalone HWND -based UI element. It’s not possible to detach the quick access toolbar from ribbon bar. The quick access toolbar cannot be re-docked or switched to floating state. You should create one additional toolbar and put it to the left side of the main frame window.
|
|
Offer Har
|
Jan 17, 2010 - 10:52 PM
|
Hi, We would like to have these two functionalities in our grid: When a user paste text onto a cell, even if the cell is not in edit mode, the text will be pasted - currently we need to double click or F2 the cell and only then paste - this is slowinf the edit process down. Is this feature avaialbe? Thanks, Ron.
|
|
Technical Support
|
Jan 19, 2010 - 1:22 PM
|
Thank you for reporting us the unwanted assertion / crash issue with number cells. To fix it, please add the following method into the CExtGridCellNumberBase class:
virtual void TextSetOnPaste(
__EXT_MFC_SAFE_LPCTSTR str = __EXT_MFC_SAFE_LPCTSTR(NULL), // empty text
bool bAllowChangeDataType = false
);
void CExtGridCellNumberBase::TextSetOnPaste(
__EXT_MFC_SAFE_LPCTSTR str, // = __EXT_MFC_SAFE_LPCTSTR(NULL) // empty text
bool bAllowChangeDataType // = false
)
{
__EXT_DEBUG_GRID_ASSERT_VALID( this );
bAllowChangeDataType = false;
CExtGridCellVariant::TextSetOnPaste( str, bAllowChangeDataType );
}
|
|
Technical Support
|
Jan 19, 2010 - 1:22 PM
|
The CExtGridCell::TextSetOnPaste() and CExtGridWnd::OnGbwAccelCommand virtual methods can be overridden for catching the grid cell modifications when performing pasting from clipboard.
|
|
Offer Har
|
Jan 18, 2010 - 9:09 PM
|
Thanks - it works great... however, I have one problem with that - We do some operations in OnGridCellInputComplete and in OnGridCellInplaceControlTextInputVerify , which are not called when we use these accelerated commands. what are the function called when a cell’s text is changed using the cut and paste accelerated commands?
|
|
Technical Support
|
Jan 18, 2010 - 1:32 PM
|
Yes. The CExtGridWnd class supports clipboard operations and the copied/paste text is compatible both with text editors and Excel. You should specify appropriate __EGSA_*** flags in the CExtGridBaseWnd::m_dwSupportedAccelCommands property.
|
|
Offer Har
|
Jan 18, 2010 - 9:34 PM
|
Dear Support, I think that also the build-in cells do not handle this paste operation very well- If you try and paste a text into a CExtGridCellNumberBase derived cell, the application crashes in an assert. I guess it’s because the cell expect numbers only, and when text it pasted, it (same as my cell...) did not know about it, and did not handle it correctly. Is there any way to unify the OnGridCellInputComplete and OnGridCellInplaceControlTextInputVerify , which are already there, with the cell paste & cut? I’m sure this will save a lot of us a lot of time... Thanks, Ron.
|
|
Luis Alberto Pereira
|
Jan 14, 2010 - 3:40 PM
|
Reply I created a new post because I could not reply the reply post for technical support. This post is continuationa of this: www.prof-uis.com/prof-uis/tech-support/general-forum/repositionbars-windows-xp-x-windows-vista-66570.aspx, Dear technical support, I did not understand your orientation. What exactly I need to do in my code do solve the problem with VS2008. Follow you post: Please take at the end of the code snippet from your .cpp file. The following line is the most interesting: RepositionBars( 0, 0xFFFF, nID );
The nID variable is the identifier of the window which should occupy the central space which is free of control bars occupying their paces near borders. If the nID variable is set to IDC_STATIC value, then the RepositionBars( 0, 0xFFFF, nID ); code will work well compiled with Visual Studio 2005 or earlier. It will position the central window correctly. But it will not work in Visual Studio 2008 or later. This is specific improvement introduced in Visual Studio 2008. That’s why Prof-UIS uses its own __EXT_MFC_IDC_STATIC value instead of MFC’s IDC_STATIC value.
Thanks,
|
|
Luis Alberto Pereira
|
Jan 19, 2010 - 5:52 AM
|
Hi, thanks for help, but I did not understand when you say IDC_STATIC dialog control. In CMainFrame I´m creating my deriveted CView class (m_wndAxiView) under CExtControlBar (m_wndRBAxiView) Where is the problem ? Thanks,
if( ! m_wndRBAxiView.Create(_T("Axial View"),this,ID_VIEW_AXI_RBBAR))
{ TRACE0("Failed to create m_wndResizableBar0\n"); return -1; // fail to create
} this->m_wndRBAxiView.EnableDocking( CBRS_ALIGN_ANY ); if( !this->m_wndAxiView.Create(NULL,NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0), &m_wndRBAxiView,AFX_IDW_PANE_FIRST)) { TRACE0("Failed to create m_wndDockedCtrlEdit\n"); return -1; // fail to create
}
|
|
Technical Support
|
Jan 19, 2010 - 1:21 PM
|
The code snippet in your message creates a resizable control bar window (m_wndRBAxiView ) and then creates some other window inside it (m_wndAxiView ). This code snippet is OK. The resizable bar requires only one child window inside it. This child window can have any dialog control identifier. This code snippet is not related to the problem. The problem is hidden somewhere inside m_wndAxiView window which is, we suspect, the container for one Prof-UIS toolbar window and one 3-D model view window. Please provide us with the source code of the m_wndAxiView window.
|
|
Luis Alberto Pereira
|
Jan 20, 2010 - 4:40 AM
|
Thanks for help, I´m sending the .h and .cpp code. VTKViewAxial.h #ifndef __VtkViewAxial_h
#define __VtkViewAxial_h
#pragma once
#include "implantplandoc.h"
#include "vtkRenderer.h"
#include "vtkWin32OpenGLRenderWindow.h"
#include "vtkWin32RenderWindowInteractor.h"
#include "vtkInteractorStyleImage.h"
#include "interactorvtkview.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkProperty.h"
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
#include "vtkVolumeProperty.h"
#include "vtkImageData.h"
#include "vtkVolumeTextureMapper3D.h"
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkDICOMImageReader.h"
#include "VtkWrapperText.h"
#include "vtkcommand.h"
#include "vtkDistanceWidget.h"
#include "vtkseedwidget.h"
#include "vtkDistanceRepresentation2D.h"
#include "vtkmath.h"
#include "vtkaxisactor2d.h"
#include "vtkPointHandleRepresentation2D.h"
#include "vtkProperty2D.h"
#include "vtkImageActor.h"
#include "vtkpointpicker.h"
#include "vtkSeedRepresentation.h" //#define VTKVIEWAXIAL_CLASSNAME _T("VTKViewAxial") // Window class name #define FmtStr(str_out, strm) { std::ostringstream oss; oss << strm; str_out = oss.str(); } class CVTKViewAxial : public CView
{
public: // create from serialization only
CVTKViewAxial();
DECLARE_DYNCREATE(CVTKViewAxial) class vtkDistanceAxiCallback : public vtkCommand
{
public:
static vtkDistanceAxiCallback *New()
{ return new vtkDistanceAxiCallback; }
void vtkDistanceAxiCallback::Execute(vtkObject*, unsigned long eid, void* callData)
{
if ( eid == vtkCommand::InteractionEvent ||
eid == vtkCommand::EndInteractionEvent ||
eid == vtkCommand::MouseMoveEvent ||
eid == vtkCommand::MouseWheelBackwardEvent ||
eid == vtkCommand::MouseWheelForwardEvent)
{
double pos1[3], pos2[3];
// Modify the measure axis
this->Distance->GetPoint1WorldPosition(pos1);
this->Distance->GetPoint2WorldPosition(pos2);
double dist=sqrt(vtkMath::Distance2BetweenPoints(pos1,pos2));
//double dist=(pos1[0]>pos2[0]?pos1[0]-pos2[0]:pos2[0]-pos1[0]); //char title[256];
CString title;
this->Distance->GetAxis()->SetRange(0.0,dist);
//sprintf(title,"%-#6.3g mm",dist);
title.Format(_T("%-#6.3g mm"),dist);
this->Distance->GetAxis()->SetTitle(title.GetBuffer());
}
else
{
if (callData == 0)
return;
int pid = *(reinterpret_cast<int*>(callData));
//From the point id, get the display coordinates
double pos1[3], pos2[3], *pos;
this->Distance->GetPoint1DisplayPosition(pos1);
this->Distance->GetPoint2DisplayPosition(pos2);
if ( pid == 0 )
{
pos = pos1;
}
else
{
pos = pos2;
} // Okay, render without the widget, and get the color buffer
int enabled = this->DistanceWidget->GetEnabled();
if ( enabled )
{
this->DistanceWidget->SetEnabled(0); //does a Render() as a side effect
} // Pretend we are doing something serious....just randomly bump the
// location of the point.
double p[3];
p[0] = pos[0] + static_cast<int>(vtkMath::Random(-5.5,5.5));
p[1] = pos[1] + static_cast<int>(vtkMath::Random(-5.5,5.5));
p[2] = 0.0;
// Set the new position
if ( pid == 0 )
{
this->Distance->SetPoint1DisplayPosition(p);
}
else
{
this->Distance->SetPoint2DisplayPosition(p);
} // Side effect of a render here
if ( enabled )
{
this->DistanceWidget->SetEnabled(1);
}
}
} vtkDistanceAxiCallback():Renderer(0),RenderWindow(0),DistanceWidget(0),Distance(0) {}
vtkRenderer *Renderer;
vtkWin32OpenGLRenderWindow *RenderWindow;
vtkDistanceWidget *DistanceWidget;
vtkDistanceRepresentation2D *Distance; double *m_pSliceThickness;
long *m_pNumberPixelsAlongAxis;
double *m_pPixelSizeMilimeter; };
class vtkSeedAxiCallback : public vtkCommand
{
public:
static vtkSeedAxiCallback *New()
{ return new vtkSeedAxiCallback; }
virtual void Execute(vtkObject*, unsigned long eid, void *calldata)
{
if (eid == vtkCommand::PlacePointEvent)
{
numberofseeds = this->SeedRepresentation->GetNumberOfSeeds();
this->SeedRepresentation->GetSeedDisplayPosition(numberofseeds-1, point);
}
}
//vtkCommand::CursorChangedEvent
vtkSeedAxiCallback() : SeedRepresentation(0) {}
vtkSeedRepresentation *SeedRepresentation;
int numberofseeds;
double point[3];
};
class CNavigationBar : public CExtToolControlBar
{
public:
CNavigationBar()
{
}
~CNavigationBar()
{
} public: //Controls
CExtComboBox m_cmbDistances;
CExtComboBox m_cmbPoints; public: //methods
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if( message == WM_CONTEXTMENU )
return 0L;
if( message == WM_LBUTTONDOWN
|| message == WM_LBUTTONUP
|| message == WM_MBUTTONDOWN
|| message == WM_MBUTTONUP
|| message == WM_RBUTTONDOWN
|| message == WM_RBUTTONUP
)
{
HWND hWndThis = GetSafeHwnd();
ASSERT( hWndThis != NULL );
ASSERT( ::IsWindow( hWndThis ) );
HWND hWndParent = ::GetParent( hWndThis );
ASSERT( hWndParent != NULL );
ASSERT( ::IsWindow( hWndParent ) );
HWND hWndFocus = ::GetFocus();
if( hWndFocus == NULL
|| hWndFocus == hWndThis
|| ::IsChild( hWndThis, hWndFocus )
)
::SetFocus( hWndParent );
else if( ! ::IsChild( hWndParent, hWndFocus ) )
::SetFocus( hWndParent );
}
return CExtToolControlBar::WindowProc(message,wParam,lParam);
} bool InitNavigationBar()
{
m_bPresubclassDialogMode = true;
LPCTSTR pn = AfxGetApp()->m_pszProfileName; if( !m_cmbDistances.Create(
WS_CHILD | WS_VISIBLE | CBS_DROPDOWN, CRect( 0, 0, 150, 180 ), this, //&m_wndToolBarMain,
ID_TBAV_CMBDISTANCES)
|| !this->SetButtonCtrl(this->CommandToIndex(m_cmbDistances.GetDlgCtrlID()), &m_cmbDistances))
{
TRACE0("Failed to create help search combobox\n" );
return -1;
}
m_cmbDistances.SetItemHeight( -1, 16 );
m_cmbDistances.SetFont( &g_PaintManager->m_FontNormal );
g_CmdManager->CmdGetPtr(pn, m_cmbDistances.GetDlgCtrlID())->m_sMenuText = _T( "Measures" ); if( !m_cmbPoints.Create(
WS_CHILD | WS_VISIBLE | CBS_DROPDOWN, CRect( 0, 0, 150, 180 ), this, //&m_wndToolBarMain,
ID_TBAV_CMBPOINTS)
|| !this->SetButtonCtrl(this->CommandToIndex(m_cmbPoints.GetDlgCtrlID()), &m_cmbPoints))
{
TRACE0("Failed to create help search combobox\n" );
return -1;
}
m_cmbPoints.SetItemHeight( -1, 16 );
m_cmbPoints.SetFont( &g_PaintManager->m_FontNormal );
g_CmdManager->CmdGetPtr(pn, m_cmbPoints.GetDlgCtrlID())->m_sMenuText = _T( "Points" ); return true; }
}; // class CNavigationBar CNavigationBar m_wndToolbar; public:
virtual ~CVTKViewAxial();
virtual void OnDraw(CDC* pDC); // overridden to draw this view
void Pipeline ( void );
void ResetSize(int cx, int cy); enum {WIDGET_NULL, WIDGET_RULER, WIDGET_SEED}; protected:
//BOOL RegisterWindowClass(); public:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL private: //renderrizacao
vtkRenderer *m_ren;
vtkWin32OpenGLRenderWindow *m_renWin;
vtkWin32RenderWindowInteractor *m_iren;
vtkInteractorStyleImage *m_irenStyle;
//CInteractorVTKView *m_irenStyle; //widget distance
vtkPointHandleRepresentation2D* m_pPtDistHandle2D;
vtkDistanceRepresentation2D* m_pDistRepr2D;
vtkDistanceWidget* m_pDistWidget;
vtkDistanceAxiCallback* m_DistCallback; //vtkPointPicker* picker;
//vtkPickerAxiCallback* m_PickerCallback; vtkSeedWidget* m_pSeedWidget;
vtkSeedAxiCallback* m_SeedCallback;
vtkPointHandleRepresentation2D* m_pSeedHandle;
vtkSeedRepresentation* m_pSeedRepr; #ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif protected:
// Generated message map functions public:
//{{AFX_MSG(CVTKViewAxial)
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP() public:
double m_zslicepos;
int m_zsliceidx; public:
CImplantDoc* GetMainFrmDoc(void);
protected:
virtual void PostNcDestroy(); int m_flg_ResetCamera; public:
void NewMeasureDistance(void);
protected:
int m_flg_widget;
int m_flg_widget_selected;
public:
void WidgetSelection(void);
void NewSeed(void);
}; #endif VTKViewAxial.CPP #include "stdafx.h"
#include "ImplantPlan.h"
#include "VTKViewAxial.h"
#include "mainfrm.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkContourFilter.h"
#include "vtkImageData.h"
#include "vtkImageMapToColors.h"
#include "vtkimagemapper.h"
#include "vtkLight.h"
#include "vtkLookupTable.h"
#include "vtkOutlineFilter.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyDataNormals.h"
#include "vtkPropPicker.h"
#include "vtkProperty.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkStripper.h"
#include "VtkObserverWindowLevel.h"
#include "VtkObserverErrorWarning.h"
#include "VtkObserverFileLoad.h"
#include "dlgnewmeasuredistance.h"
#include "measuredistance.h"
#include "vtkWidgetEvent.h"
#include "vtkAxisActor.h"
#include "vtkAxisActor2D.h"
#include "vtkCubeAxesActor2D.h"
#include "vtkTextProperty.h" #include <string>
#include <sstream>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CVTKViewAxial IMPLEMENT_DYNCREATE(CVTKViewAxial, CView) BEGIN_MESSAGE_MAP(CVTKViewAxial, CView)
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
ON_COMMAND(ID_TBAV_DISTANCE, CVTKViewAxial::NewMeasureDistance)
ON_COMMAND(ID_TBAV_SEED, CVTKViewAxial::NewSeed)
ON_WM_SIZE()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
CVTKViewAxial::CVTKViewAxial()
: m_flg_ResetCamera(true)
, m_flg_widget(0)
, m_flg_widget_selected(0)
,m_zslicepos(0)
,m_zsliceidx(-1)
{
//this->RegisterWindowClass();
this->m_ren = vtkRenderer::New();
this->m_renWin = vtkWin32OpenGLRenderWindow::New();
this->m_iren = vtkWin32RenderWindowInteractor::New();
this->m_irenStyle = vtkInteractorStyleImage::New();
//this->m_irenStyle = CInteractorVTKView::New();
this->m_iren->SetInteractorStyle(m_irenStyle);
}
CVTKViewAxial::~CVTKViewAxial()
{
// Delete the the renderer, window and interactor objects.
//this->m_iren->RemoveObserver(m_PickerCallback);
this->m_flg_widget = this->WIDGET_NULL;
this->WidgetSelection();
this->m_ren->Delete();
this->m_iren->Delete();
this->m_renWin->Delete();
}
void CVTKViewAxial::OnDraw(CDC* pDC)
{
CImplantDoc* pDoc = this->GetMainFrmDoc();
//ASSERT_VALID(pDoc);
if ( !this->m_iren->GetInitialized() )
{
this->m_iren->Initialize();
Pipeline();
CRect rect;
this->GetClientRect(&rect);
RepositionBars( 0, 0xFFFF, 0);
this->m_renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);
}
else
Pipeline(); if ( pDC->IsPrinting() )
{
this->BeginWaitCursor();
// Obtain the size of the printer page in pixels.
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
// Get the size of the window in pixels.
int *size = this->m_renWin->GetSize();
int cxWindow = size[0];
int cyWindow = size[1];
float fx = float(cxPage) / float(cxWindow);
float fy = float(cyPage) / float(cyWindow);
float scale; // = min(fx,fy);
if (fx < fy)
scale = fx;
else
scale = fy;
int x = int(scale * float(cxWindow));
int y = int(scale * float(cyWindow));
this->m_renWin->SetupMemoryRendering(cxWindow, cyWindow, pDC->GetSafeHdc());
this->m_renWin->Render();
HDC memDC = this->m_renWin->GetMemoryDC();
StretchBlt(pDC->GetSafeHdc(),0,0,x,y,memDC,0,0,cxWindow,cyWindow,SRCCOPY);
this->m_renWin->ResumeScreenRendering();
this->EndWaitCursor();
}
} void CVTKViewAxial::ResetSize(int cx, int cy)
{
// Reset the render window size, reposition the text actors.
this->m_renWin->SetSize(cx, cy);
} void CVTKViewAxial::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
CRect rect;
this->GetClientRect(&rect);
RepositionBars( 0, 0xFFFF, 0);
this->m_renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);
} BOOL CVTKViewAxial::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
} BOOL CVTKViewAxial::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
if ((CView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))==-1)
return false; this->m_renWin->AddRenderer(this->m_ren);
//this->m_renWin->SetParentId(this->m_hWnd);
this->m_renWin->SetParentId(this->GetSafeHwnd());
this->m_iren->SetRenderWindow(this->m_renWin);
m_wndToolbar.m_bPresubclassDialogMode = true; if( !m_wndToolbar.Create(_T(""), this, AFX_IDW_DIALOGBAR, WS_CHILD|WS_VISIBLE
|CBRS_ALIGN_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC))
{
ASSERT( FALSE );
return -1;
}
if( !m_wndToolbar.LoadToolBar(IDR_TOOLBAR_AXIALVIEW) )
{
ASSERT( FALSE );
return -1;
}
if(!m_wndToolbar.InitNavigationBar())
return -1; RepositionBars(0, 0xFFFF, 0);
return true;
} LRESULT CVTKViewAxial::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
//case WM_PAINT:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
case WM_CHAR:
case WM_TIMER:
if (this->m_iren->GetInitialized())
{
return vtkHandleMessage2(this->GetSafeHwnd(), message, wParam, lParam, this->m_iren);
}
break;
}
return CView::WindowProc(message, wParam, lParam);
} void CVTKViewAxial::Pipeline()
{
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
if (pFrame->m_pDoc == NULL)
return; if (!pFrame->m_pDoc->m_flg_img3D_Loaded)
return; if (pFrame->m_wndView.m_flg_widget_selected != pFrame->m_wndView.WIDGET_3D)
return; if (this->m_zsliceidx != pFrame->m_wndView.m_planeWidgetZ->GetSliceIndex())
{
this->m_zsliceidx = pFrame->m_wndView.m_planeWidgetZ->GetSliceIndex();
this->m_zslicepos = pFrame->m_wndView.m_planeWidgetZ->GetSlicePosition(); //this->m_DistCallback->m_pNumberPixelsAlongAxis = &pFrame->m_pDoc->m_0028_0100_NumberPixelsAlongAxis;
//this->m_DistCallback->m_pPixelSizeMilimeter = &pFrame->m_pDoc->m_0028_0030_PixelSizeMilimeter;
//this->m_DistCallback->m_pSliceThickness = &pFrame->m_pDoc->m_0018_0050_SliceThickness; //if (this->m_ren->GetNumberOfPropsRendered() > 0)
//{
// this->m_ren->RemoveAllProps();
// this->m_ren->RemoveAllViewProps();
//} vtkImageMapToColors* colorMap = vtkImageMapToColors::New();
colorMap->PassAlphaToOutputOff();
colorMap->SetActiveComponent(0);
colorMap->SetOutputFormatToLuminance();
colorMap->SetInput(pFrame->m_wndView.m_planeWidgetZ->GetResliceOutput());
colorMap->SetLookupTable(pFrame->m_wndView.m_planeWidgetX->GetLookupTable()); vtkImageActor* imageActor = vtkImageActor::New();
imageActor->SetInput(colorMap->GetOutput());
imageActor->PickableOff();
imageActor->SetPosition(0, 0, 0); double iabounds[6];
imageActor->GetBounds(iabounds);
double *center = imageActor->GetCenter();
vtkTextProperty* tprop = vtkTextProperty::New();
tprop->SetColor(0, 0, 1);
vtkCubeAxesActor2D* axes2 = vtkCubeAxesActor2D::New();
axes2->SetViewProp(imageActor);
axes2->SetCamera(this->m_ren->GetActiveCamera());
axes2->SetLabelFormat("%6.4g");
axes2->SetFlyModeToClosestTriad();
axes2->SetFontFactor(1);
axes2->ScalingOn();
axes2->SetAxisTitleTextProperty(tprop);
axes2->SetAxisLabelTextProperty(tprop);
axes2->SetNumberOfLabels(10);
axes2->SetZAxisVisibility(false);
this->m_ren->AddViewProp(axes2);
axes2->GetXAxisActor2D()->GetProperty()->SetColor(0, 0, 1);
axes2->GetYAxisActor2D()->GetProperty()->SetColor(0, 0, 1);
this->m_ren->AddActor(imageActor); this->m_renWin->Render();
if (this->m_flg_ResetCamera)
{
this->m_ren->ResetCamera();
this->m_flg_ResetCamera = false;
} colorMap->Delete();
imageActor->Delete();
axes2->Delete();
tprop->Delete();
} //if (this->m_zsliceidx != pFrame->m_wndView.m_planeWidgetZ->GetSliceIndex()) } // CVTKViewAxialCoronal printing
BOOL CVTKViewAxial::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
} void CVTKViewAxial::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
} void CVTKViewAxial::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
} // CVTKViewAxial diagnostics
#ifdef _DEBUG
void CVTKViewAxial::AssertValid() const
{
CView::AssertValid();
} void CVTKViewAxial::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
} #endif //_DEBUG
CImplantDoc* CVTKViewAxial::GetMainFrmDoc(void)
{
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
return pFrame->GetDocument();
}
void CVTKViewAxial::PostNcDestroy()
{
return;
} void CVTKViewAxial::NewMeasureDistance(void)
{
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
if (pFrame->m_pDoc == NULL)
return; if (!pFrame->m_pDoc->m_flg_img3D_Loaded)
return; CDlgNewMeasureDistance dlg;
dlg.m_axis = pFrame->A_AXIS;
if (!dlg.DoModal())
return;
this->m_flg_widget = this->WIDGET_RULER;
this->WidgetSelection();
}
void CVTKViewAxial::WidgetSelection(void)
{
/*
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
if (pFrame->m_pDoc == NULL)
return;
if (!pFrame->m_pDoc->m_flg_img3D_Loaded)
return;+
*/ if ((this->m_flg_widget_selected == this->WIDGET_RULER) &&
(this->m_flg_widget != this->WIDGET_RULER))
{
m_pDistWidget->RemoveObserver(m_DistCallback);
m_DistCallback->Delete();
m_pDistWidget->Delete();
m_pDistRepr2D->Delete();
m_pPtDistHandle2D->Delete();
} if ((this->m_flg_widget_selected == this->WIDGET_SEED) &&
(this->m_flg_widget != this->WIDGET_SEED))
{
m_pSeedWidget->RemoveObserver(m_SeedCallback);
m_SeedCallback->Delete();
m_pSeedWidget->Delete();
m_pSeedRepr->Delete();
m_pSeedHandle->Delete();
} if (m_flg_widget == this->WIDGET_NULL)
return; if ((this->m_flg_widget_selected != this->WIDGET_RULER) &&
(this->m_flg_widget == this->WIDGET_RULER))
{
//distance
// Create the widget and its representation
m_pPtDistHandle2D = vtkPointHandleRepresentation2D::New();
m_pPtDistHandle2D->GetProperty()->SetColor(1,0,0); m_pDistRepr2D = vtkDistanceRepresentation2D::New();
m_pDistRepr2D->SetHandleRepresentation(m_pPtDistHandle2D);
m_pDistRepr2D->GetAxis()->SetNumberOfMinorTicks(4);
m_pDistRepr2D->GetAxis()->SetTickLength(9);
m_pDistRepr2D->GetAxis()->SetTitlePosition(0.2); m_pDistWidget = vtkDistanceWidget::New();
m_pDistWidget->SetInteractor(this->m_iren);
m_pDistWidget->CreateDefaultRepresentation();
m_pDistWidget->SetRepresentation(m_pDistRepr2D);
m_DistCallback = vtkDistanceAxiCallback::New();
m_DistCallback->Renderer = this->m_ren;
m_DistCallback->RenderWindow = this->m_renWin;
m_DistCallback->Distance = m_pDistRepr2D;
m_DistCallback->DistanceWidget = m_pDistWidget;
m_DistCallback->m_pNumberPixelsAlongAxis = NULL;
m_DistCallback->m_pPixelSizeMilimeter = NULL;
m_DistCallback->m_pSliceThickness = NULL;
m_pDistWidget->AddObserver(vtkDistanceAxiCallback::AnyEvent, m_DistCallback);
m_pDistWidget->On();
}
if ((this->m_flg_widget_selected != this->WIDGET_SEED) &&
(this->m_flg_widget == this->WIDGET_SEED))
{
//seed
m_pSeedHandle = vtkPointHandleRepresentation2D::New();
m_pSeedHandle->GetProperty()->SetColor(1,0,0);
m_pSeedRepr = vtkSeedRepresentation::New();
m_pSeedRepr->SetHandleRepresentation(m_pSeedHandle);
m_pSeedWidget = vtkSeedWidget::New();
m_pSeedWidget->SetInteractor(this->m_iren);
m_pSeedWidget->SetRepresentation(m_pSeedRepr); m_SeedCallback = vtkSeedAxiCallback::New();
m_SeedCallback->SeedRepresentation = m_pSeedRepr;
m_pSeedWidget->AddObserver(vtkCommand::PlacePointEvent,m_SeedCallback);
m_pSeedWidget->AddObserver(vtkCommand::InteractionEvent,m_SeedCallback);
m_pSeedWidget->On();
} this->m_flg_widget_selected = this->m_flg_widget;
} void CVTKViewAxial::NewSeed(void)
{
this->m_flg_widget = this->WIDGET_SEED;
this->WidgetSelection();
}
|
|
Technical Support
|
Jan 20, 2010 - 1:34 PM
|
We think the problem is hidden in these methods:
void CVTKViewAxial::ResetSize( int cx, int cy )
{
// Reset the render window size, reposition the text actors.
this->m_renWin->SetSize( cx, cy );
}
void CVTKViewAxial::OnSize( UINT nType, int cx, int cy )
{
CView::OnSize( nType, cx, cy );
CRect rect;
this->GetClientRect( &rect );
RepositionBars( 0, 0xFFFF, 0 );
this->m_renWin->SetSize( rect.right - rect.left, rect.bottom - rect.top );
}
They should be improved: void CVTKViewAxial::ResetSize( int cx, int cy )
{
cx; cy; // unused, we don’t need them
if( m_renWin->GetSafeHwnd() == NULL )
return;
UINT nCenterID = UINT( m_renWin->GetDlgCtrlID() );
ASSERT( 0 < nCenterID && nCenterID < 0xFFFF );
RepositionBars( 0, 0xFFFF, nCenterID );
CRect rc;
this->m_renWin->GetWindowRect( &rc );
m_renWin->SetSize( rc.Width(), rc.Height() );
}
void CVTKViewAxial::OnSize( UINT nType, int cx, int cy )
{
CView::OnSize( nType, cx, cy );
if (m_renWin->GetSafeHwnd() == NULL )
return;
UINT nCenterID = UINT( m_renWin->GetDlgCtrlID() );
ASSERT( 0 < nCenterID && nCenterID < 0xFFFF );
RepositionBars( 0, 0xFFFF, nCenterID );
CRect rc;
this->m_renWin->GetWindowRect( &rc );
m_renWin->SetSize( rc.Width(), rc.Height() );
}
|
|
Luis Alberto Pereira
|
Jan 20, 2010 - 6:33 PM
|
Hi support, I saw your suggestion, but it not work. m_renWin is a VTK class vtkWin32OpenGLRenderWindow witch is attached in a CVTKVIewAxial at CVTKViewAxial Create method. Before that, m_renWin don´t have the GetSafeHwnd, GetDlgCtrlID and GetWindowRect. I understand that m_renWin is attached to CCTKViewAxial and you behavior depends to last one behavior. This methods sare under CVTKViewAxial. I think this problem is some bug between VTK classes and MFC/VS2008 classes. I wiill think an alternative funcitionality in substituition of my Toolbar in the view. If you have another insight, pleases, tell me. Thanks,
|
|
Technical Support
|
Jan 21, 2010 - 12:10 PM
|
You should make the m_renWin object HWND -based. Your 3D rendering window should be a standalone window responsible for 3D output only and not containing any other child windows. This is very recommended for OpenGL, DirectX, Video and any other hardware accelerated screen output. Please take a look at the AviFrames sample application. It draws frames from AVI file into the scrollable window and user assumes the video is playing on the screen. It’s possible to magnify the video frame size and the view window becomes scrollable. The view window is one window and it does not draw video frames. The view window contains the child window. This child window has size of video frame and it’s responsible for rendering video frames only. When the view window becomes scrolling, then it’s simply shifting position of its child video frame rendering window. It’s not possible to implement such video scrolling based on direct video frame rendering into the scrollable view window.
|
|
Technical Support
|
Jan 17, 2010 - 10:56 AM
|
We just meant the view window’s dialog control identifier must be any value but not the IDC_STATIC . If you used the IDC_STATIC dialog control identifier when creating your view window, then the RepostionBars() API of VS2008/MFC9 will not move your view window. This is the only known difference which can produce the issue you come across in VS2008. Please check this. If your view window really uses the IDC_STATIC dialog control identifier, then please change it to something else. The AFX_IDW_PANE_FIRST is the good choice and it will work in any VS.
|
|
Luis Alberto Pereira
|
Jan 19, 2010 - 11:24 AM
|
Hi, thanks for help, but I did not understand when you say IDC_STATIC dialog control. In CMainFrame I´m creating my deriveted CView class (m_wndAxiView) under CExtControlBar (m_wndRBAxiView) Where is the problem ? Thanks,
{ TRACE0("Failed to create m_wndResizableBar0\n"); return -1; // fail to create } this->m_wndRBAxiView.EnableDocking( CBRS_ALIGN_ANY ); if( !this->m_wndAxiView.Create(NULL,NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0), &m_wndRBAxiView,AFX_IDW_PANE_FIRST)) { TRACE0("Failed to create m_wndDockedCtrlEdit\n"); return -1; // fail to create } if( ! m_wndRBAxiView.Create(_T("Axial View"),this,ID_VIEW_AXI_RBBAR))
|
|
tera tera
|
Jan 13, 2010 - 1:59 AM
|
Hello. Please teach a method to examine a pin state of the docking bar.
Please teach a method to return to the state of the normal bar from AutoHideBar.
|
|
Technical Support
|
Jan 13, 2010 - 11:08 AM
|
The CExtControlBar::AutoHideModeGet() and CExtControlBar::AutoHideModeSet() methods allow you to detect the auto-hidden state of control bar, switch it to auto-hidden state and back. The floating bars cannot be switched into auto hidden state. If the CWnd::GetParentFrame() API invoked for some CExtControlBar window returns pointer to the CMiniFrameWnd window, then the bar is somewhere in a floating palette window. If this API returns pointer to the main frame window, then the bar is somewhere docked in this main frame and you can make it auto-hidden. The dynamic resizable bars should use the CExtDynamicControlBar::BarStateGet() and CExtDynamicControlBar::BarStateSet() methods for managing dynamic bar state.
|
|