在CAcUiTabChildDialog中使用点取或者(拾取)时卡住的问题

问题描述:在Tab的对话框中,其子对话框CAcUiTabChildDialog中用点取或者(拾取)时卡住的问题

在子对话框中:

    BeginEditorCommand();

   CompleteEditorCommand();

 

解决方案:

此类问题需要在对话框CAcUiTabMainDialog中添加

#define MSG_BEGIN_EDITOR_CAL WM_USER+1
#define MSG_END_EDITOR_CAL WM_USER+2

ON_MESSAGE(MSG_BEGIN_EDITOR_CAL,BeginEditor)
ON_MESSAGE(MSG_END_EDITOR_CAL,EndEditor)

 

afx_msg LRESULT XXX_Main::BeginEditor(WPARAM wparam, LPARAM lparam)
{
    BeginEditorCommand();
    return 0;
}

afx_msg LRESULT XXX_Main::EndEditor(WPARAM wparam, LPARAM lparam)
{
    CompleteEditorCommand();
    return 0;
}

 

而子对话框调用

void XXX_Sub::OnBnClickedButtonpoint()
{
    // TODO:  在此添加控件通知处理程序代码
    UpdateData();

    GetParent()->SendMessage(MSG_BEGIN_EDITOR_CAL);

    //选择点
    ads_point pt;
    int retcode = acedGetPoint(NULL, _T("选取内部参考点:"), pt);

    GetParent()->SendMessage(MSG_END_EDITOR_CAL);

    if (retcode != RTNORM)
        return;

    T_S_BASEFUN_AUTOCAD.PointTran(1, 0, pt);
    m_ptRef.set(pt[0], pt[1], pt[2]);
    UpdateData(false);
}
posted @ 2018-12-12 16:32  unicornsir  阅读(349)  评论(0编辑  收藏  举报