开发者社区> 问答> 正文

vc无法创建dialog? 400 报错

vc无法创建dialog? 400 报错

这是int CDialog::DoModal()里面的语句   

TRY
    {
        // create modeless dialog
        AfxHookWindowCreate(this);
        if (CreateDlgIndirect(lpDialogTemplate,CWnd::FromHandle(hWndParent), hInst))
        {
            if (m_nFlags & WF_CONTINUEMODAL)
            {
                // enter modal loop
                DWORD dwFlags = MLF_SHOWONIDLE;
                if (GetStyle() & DS_NOIDLEMSG)
                    dwFlags |= MLF_NOIDLEMSG;
                VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
            }

            // hide the window before enabling the parent, etc.
            if (m_hWnd != NULL)
                SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW|
                    SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
        }
    }
    CATCH_ALL(e)
    {
        DELETE_EXCEPTION(e);
        m_nModalResult = -1;
    }

    END_CATCH_ALL

执行这个的时候出错if (CreateDlgIndirect(lpDialogTemplate,CWnd::FromHandle(hWndParent), hInst))

求解答方法。

展开
收起
爱吃鱼的程序员 2020-06-02 17:12:34 553 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    已经解决,一个控件的原因。

    2020-06-02 17:12:46
    赞同 展开评论 打赏
问答分类:
C++
问答地址:
问答排行榜
最热
最新

相关电子书

更多
A Developer's View 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载