views:

314

answers:

1

Hi now i am working in 2003 vc++ and i am converting(migrating) my project in to vc 2008 or new vc 2010 Beta,i saw the feature pack of 2008,2010 regards CDockable Pane(Auto Hode,floating),so i require this features ,i want to place a dialogbox or dialog bar into pane(CDockable Pane class), so i done this in my following code

Myframe Code snippet is :

if (!m_MyPane.Create(L"MyPane", this, CRect(0,0,0,0), true, IDD_DIALOG1, WS_CHILD|WS_VISIBLE)) return -1; AddDockSite(); EnableDocking(CBRS_ALIGN_ANY); EnableAutoHidePanes(CBRS_ALIGN_ANY); m_MyPane.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_MyPane, AFX_IDW_DOCKBAR_RIGHT);

MyPane class Definition is :

include "stdafx.h"

include "Pane.h"

include "Resource.h"

include "MainFrm.h"

include "soft1.h"

ifdef _DEBUG

undef THIS_FILE

static char THIS_FILE[]=FILE;

define new DEBUG_NEW

endif

CPane1::CPane1() { } CPane1::~CPane1() {

}

BEGIN_MESSAGE_MAP(CPane1, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() END_MESSAGE_MAP()

int CPane1::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1;

return 0; }

void CPane1::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); }

when i build it wont shows any error and executed without error in the output the frame show the mypane but mypane didn't show IDD_DIALOG1

So is it anything am i missed please rectify my code and how to place a IDD_DIALOG1 dialogbox in to mypane

PLEASE HELP ME

REGARDS G.BALAJI

A: 

The short answer is it is very hard to put a dialog in a CDockablePane (I know as I have done it). But it is very easy to if you use a CPaneDialog instead. If you are converting a dialog that was previously in a CDialog or CDialogBar you need to turn on the "Visible" flag in the dialog editor. otherwise some odd things happen. (CDialog required the flag to be off but CPaneDialog requires it to be on.)

Andrew