开发者

How to Place DialogBar or Dialog box into pane in vc 2008 or vc 2010 Beta

Hi now i am working i开发者_StackOverflow中文版n 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


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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜