PropertyPage and DialogBar Updated question

OK i have, thusfar, figured out that i have to embed a PropertySheet onto my DialogBar. sounds pretty straightforward but when I try to do an OnCreate for the DialogBar then do a
GetTabCtrl() for the Property Sheet i get an assert. The TabCtrl comes out NULL.

I assume something isn't being initialized. apparently the CDialogBar does not have an OnInitDialog() because it is created with the mainframe window

Any help on this will be most appreciated!
[479 byte] By [jjasperXX] at [2007-11-18 17:41:26]
# 1 Re: PropertyPage and DialogBar Updated question
Write your own InitDialog function and call it after you create
the dialogbar

if(!MyDialogBar_.Create(....)
{
Handle error
}
if(!MyDialogBar_.InitDialog())
{
Handle Error
}

Have your InitDialog return a bool just in case something fails
souldog at 2007-11-11 1:26:07 >
# 2 Re: PropertyPage and DialogBar Updated question
yeah I had tried this.

I stopped the assert but my PropertyPage does not show up.

Do you know ov any alternatives to a property page for a DialogBar control?

It seems that i can't put a property page on it
jjasperXX at 2007-11-11 1:27:12 >
# 3 Re: PropertyPage and DialogBar Updated question
Yes, you can. Why don't you post the code.
souldog at 2007-11-11 1:28:08 >
# 4 Re: PropertyPage and DialogBar Updated question
ok here is my init function for the DialogBar

void PropertiesDlg::InitPropertyPage()
{
CRect rcNewPosition;
CWnd * pWndNewArea = GetDlgItem(IDC_PSHEET_AREA); // IDC_PSHEET_AREA is a picture control used as a source for the rectangle

GetWindowRect(&rcNewPosition);
ScreenToClient(&rcNewPosition);

CTabCtrl* pTabCtrl = m_property_sht->GetTabControl();
ASSERT(pTabCtrl != NULL);

CRect rcTabCtrl;
pTabCtrl->GetWindowRect(&rcTabCtrl);
ScreenToClient(&rcTabCtrl);

CRect rcPSheet;
m_property_sht->GetWindowRect(&rcPSheet);
ScreenToClient(&rcPSheet);

int dcx = rcPSheet.Width()-rcTabCtrl.Width();
int dcy = rcPSheet.Height()-rcTabCtrl.Height();

m_property_sht->MoveWindow(rcNewPosition.left, rcNewPosition.top, rcNewPosition.Width(),
rcNewPosition.Height());

pTabCtrl->SetWindowPos(NULL, 0, 0, rcNewPosition.Width(),
rcNewPosition.Height(), SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE);

int cp=m_property_sht->GetActiveIndex();

for(int i=0;i<m_property_sht->GetPageCount();i++)
m_property_sht->SetActivePage(i);

m_property_sht->SetActivePage(cp);
}

and i do this on the CDialog::OnCreate

m_property_sht = new SAIPropertSht((LPCTSTR)"Properties", this);

m_property_sht->ModifyStyle(0, WS_TABSTOP);
m_property_sht->ModifyStyleEx(0 WS_EX_CONTROLPARENT);
ModifyStyleEx(0, WS_EX_CONTROLPARENT);
jjasperXX at 2007-11-11 1:29:13 >
# 5 Re: PropertyPage and DialogBar Updated question
Here is an example of what you want. I didn't really look at your code, but I don't see where you create the property sheet window.
souldog at 2007-11-11 1:30:07 >
# 6 Re: PropertyPage and DialogBar Updated question
Wow, I forgot to create the property sheet.

how embarassing for me.

anyway, thanks a million
your help was much appreciated
jjasperXX at 2007-11-11 1:31:14 >