0

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

4

1 回答 1

2

简短的回答是很难在 CDockablePane 中放置一个对话框(我知道我已经做到了)。但是如果你使用 CPaneDialog 来代替它是很容易的。如果要转换以前在 CDialog 或 CDialogBar 中的对话框,则需要在对话框编辑器中打开“可见”标志。否则会发生一些奇怪的事情。(CDialog 要求标志关闭,但 CPaneDialog 要求它打开。)

于 2010-02-22T03:27:22.453 回答