15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Magical Toolbars

Pradeep -- pradeep@corus.com
Friday, July 05, 1996

Hello,
Env : Win 95, MSVC 4.0, MFC

This is a wierd problem I have encountered. I have an application with =
some toolbars. When I go to and return from "Print Preview" (which is =
handled by MFC) all my toolbars are suddenly visible.=20
Tracking the code I found that in "winfrm.cpp" a function =
"OnSetPreviewMode" is called which displays the first 32 control bars, =
before going into preview mode.
Is there some solution for this problem? Or some workaround?

Thanks in advance.

Pradeep.




Rkumar_at_CalSoft-ElNet@mail.cswl.com
Wednesday, July 10, 1996

[Mini-digest: 2 responses]

     Hi,
     Env : Win 95, MSVC 4.0, MFC
     
     I too have the same problem.I guess there are more legant solutions to 
     it but the way i am currently handeling this is, to show or hide the 
     relavant toolbars in the view's on activate handler. Please let me 
     know about any other workarounds.
     Thanks in advance.
     Ratan.


______________________________ Reply Separator _________________________________
Subject: Magical Toolbars
Author:  mfc-l@netcom.com at internet
Date:    7/6/96 8:06 PM


Hello,
Env : Win 95, MSVC 4.0, MFC
     
This is a wierd problem I have encountered. I have an application with = 
some toolbars. When I go to and return from "Print Preview" (which is = 
handled by MFC) all my toolbars are suddenly visible.=20
Tracking the code I found that in "winfrm.cpp" a function = 
"OnSetPreviewMode" is called which displays the first 32 control bars, = 
before going into preview mode.
Is there some solution for this problem? Or some workaround?
     
Thanks in advance.
     
Pradeep.
     

-----From: Mark Conway 

The first 32 toolbar id's are special in this sense, and this is
documented in a tech note somewhere. The workaround is to use ID's
outside the first 32 for your toolbars/dialog bars.

Mark.




Deepak Saxena -- Deepak_Saxena@ccm.ch.intel.com
Tuesday, July 09, 1996

[Mini-digest: 3 responses]


Text item: 


CMainFrame::OnPrintPreview()
{
        CFrameWnd::OnPrintPreview();

        //
        // Insert code here to disable the tool bars you want disabled
        //
}

Deepak

-----From: Chong Zhang 

Checkout the CPrintPreviewState structure, the member, dwState, is a 
bitmap of which bar on and which bar off. If for some reason, dwState is 
set to 0xffffffff before going in into the OnSetPreviewMode, then all 
first 32 bars will be displayed.

-----From: Bill Campbell 

	Rukmar,

 	Use this code to find the next available id for your toolbar
	
	unsigned int nIDToolBar;
	for (nIDToolBar = AFX_IDW_CONTROLBAR_FIRST; nIDToolBar < AFX_IDW_CONTROLBAR_FIRST + 256; nIDToolBar++)
	{
		if ( NULL == this->GetControlBar(nIDToolBar) )	// stop when we don't find a control bar
			break;
	}
	ASSERT(nIDSelector < AFX_IDW_CONTROLBAR_LAST);


Bill




| Вернуться в корень Архива |