通过
void CDao1Ctrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
if( m_hWnd )       
m_MyDlg.MoveWindow(rcBounds);
}
和int CDao1Ctrl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
m_MyDlg.Create(IDD_MYDIALOG, this);
return 0;
}
函数,在控件中添加了一个对话框,现在,想在这个对话框中放一个按钮,点击后,通过.DoModal()打开对话框,请高手帮忙给出方法和代码。谢谢!

解决方案 »

  1.   

    没听明白啊
    你是还想再弹出一个对话框是么??那就在Mydlg里加button,然后映射消息,就可以啦希望再说的明白点
      

  2.   

    就是想在Mydlg这个对话框中里加button,点击弹出新的对话框
      

  3.   

    if you implement your ocx like this,it is easy.
    http://www.codeguru.com/activex/dialogctrl.shtml
    then you can add button and dialog resource by hand.
      

  4.   

    你可以直接在资源里面编辑啊,加按钮和它的click事件不可以了吗