debug状态下编译好的一个对话框作为界面的activex控件,编译顺利通过,但是我打开control container,insert new control选择我做的这个activex,刚按下确定按钮,弹出一个错误对话框

Debug Assertion Failed!
Program:..\vc|microsoft visual studio\common\tools\tstcon32.exe
File:afxwin2.inl
line:96
然后就是终止 重试 忽略三个选项
我按下忽略,又弹出一个类似的错误框,不同的是
File:winocc.cpp
line:279
然后又是终止 重试 忽略三个选项
我按下忽略,又弹出一个类似的错误框---没有弹出了 :)现在在里边测试方法和其他功能都正常-----------------------------
我这个activex放到网页中后,打开网页的时候出现同样的错误!
-----------------------------
请问是不是我漏掉了一些初始化动作?还是其他什么原因?24小时在线等!
----------------------------------------
分不在多,真心就好---谢谢大家,帮忙up也谢谢了

解决方案 »

  1.   

    void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
    {
    ASSERT(::IsWindow(m_hWnd)); if (m_pCtrlSite == NULL)
    ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint);
    else
    m_pCtrlSite->MoveWindow(x, y, nWidth, nHeight, bRepaint);
    }
    -------------------
    279行是这个函数,我建立的是一个没有title bar的对话框,并且在ondraw中调用movewindow函数进行定位,
    m_myphonedlg.MoveWindow(rcBounds,TRUE)
    我是不是应该修改这里?怎么修改?
      

  2.   

    ASSERT(::IsWindow(m_hWnd));//line 279
    断言错误,怎么修改?
      

  3.   

    用vc6.0 mfc的向导建一个ID IDD_MYPHONE_DIALOG得以对话框为界面的activex.
    然后添加WM_CREATE得到下面的函数,并修改
    int CWebphoneCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
    {
    if (COleControl::OnCreate(lpCreateStruct) == -1)
    return -1;

    // TODO: Add your specialized creation code here
    m_myphonedlg.Create(IDD_MYPHONE_DIALOG,this);//我自己添加的

    return 0;
    }
    然后在下面的函数中修改
    void CWebphoneCtrl::OnDraw(
    CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
    {

    m_myphonedlg.MoveWindow(rcBounds,TRUE);//我自己添加的
    }
      

  4.   

    把m_myphonedlg.MoveWindow(rcBounds,TRUE);//放到oncreate里吧