BCGSoft Forums
BCGSoft Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 BCGControlBar Pro for MFC Forums
 BCGControlBar Bugs and Problems
 Use CBCGPStaticLayout in CBCGPFormView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

olivier_helin

7 Posts

Posted - 03/28/2012 :  03:15:31 AM  Show Profile  Reply with Quote
Hello,
I'm trying to create a very simple SDI application that contains an "Edit Control". This component must fill all available space at initialization and when the window size changes.

1. References
I replace all CFormView references by CBCGPFormView


2. Initialization


void CMyApplicationView::OnInitialUpdate()
{
	CBCGPFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();

	//Added to dock the Edit Control (IDC_EDIT1)
	EnableLayout();
	CBCGPStaticLayout* pLayout = (CBCGPStaticLayout*)GetLayout();
	if (pLayout != NULL)
	{
		pLayout->AddAnchor(IDC_EDIT1, CBCGPStaticLayout::e_MoveTypeBoth, CBCGPStaticLayout::e_SizeTypeBoth);
	}
}



3. Execution
The method "AddAnchor" causes "Debug Assertion Failed" in bcgplayout.cpp

if (m_pHostWnd->GetSafeHwnd () == NULL) => TRUE




When I create a simple application based on CBCGPDialog (with layout definitions in OnInitDialog method) it works perfectly.

Is "OnInitialUpdate" the good place to set my layout definitions ?

Thanks in advance,

olivier_helin

7 Posts

Posted - 03/28/2012 :  03:42:16 AM  Show Profile  Reply with Quote
=== FIXED ===
Move "EnableLayout();" in the CMyApplicationView constructor works.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To:
BCGSoft Forums © Copyright (c) 1998-2013 BCGSoft Co Ltd Go To Top Of Page
Snitz Forums 2000