在CMainFrame定义:
CCoolDialogBar m_wndDialogBar;
CTestDlg3 *pDlg;
/////////////////////
pDlg=new CTestDlg;
if (!m_wndDialogBar.Create(this, pDlg1, CString("CoolBar Demo1"), IDD_DIALOG1))
{
TRACE0("Failed to create dialogbar\n");
return 0;      // fail to create
}
    m_wndDialogBar.SetBarStyle(m_wndDialogBar.GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC);        CTestDlg中定义一个字符串变量  m_str。
           我想点击CTestDlg中的按钮,让m_str在应用程序的客户区中显示出来
            单文档的应用程序。
             谢谢大家了。
            [email protected]

解决方案 »

  1.   

    CDialogBar::Create(
       CWnd* pParentWnd,
       LPCTSTR lpszTemplateName,
       UINT nStyle,
       UINT nID 
    );
    显然你想用CTestDlg3作为一个模板来创建m_wndDialogBar。
    lpszTemplateName 
    A pointer to the name of the CDialogBar object's dialog-box resource template.
    注意:1) 模板是资源模板,ID或字符串资源名,而不是现成的对话框;
    2) CDigalogBar的基类并非CDialog,而是CControlBar。
      

  2.   

    你说的对 。CTestDlg3是一个模板。
    但是我想点击CTestDlg3中按纽,在客户区中绘制图形,曲线的。
    我应该怎么作呢?告诉我好么!
      

  3.   

    在资源中生成对话框模板,添加对话框类,然后就可以了,不要自己Create()。