几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】begineditorcommand()的一个问题? (http://www.dimcax.com/hust/showthread.php?t=6185)

yang686526 2009-04-16 09:22 AM

【转帖】begineditorcommand()的一个问题?
 
begineditorcommand()的一个问题?
begineditorcommand()的一个问题?
下面是一个按钮的消息相映函数,调用begineditorcommand();把焦点交给autocad.但都用后交给了autocad,但对话框怎么隐藏不了!
void gralibmain::onbuttoninsert()
{
// todo: add your control notification handler code here
begineditorcommand();//òt2????°?òoˉêy
ads_point basept;
insertdlg indlg;
// int nreturnvalue = indlg.domodal();
if (acedgetpoint(null, "\npick a point: ", basept) == rtnorm)
{
completeeditorcommand();
// m_strxpt.format("%g", basept[x]);
// m_strypt.format("%g", basept[y]);
// m_strzpt.format("%g", basept[z]);

}
else
{
canceleditorcommand();
}
}
同样书上的一个例子就能隐藏!
void asdkacuidialogsample::onbuttonpoint()
{
// òt2????°?ò£?2¢??????????autocadí?d?±à?-?÷
begineditorcommand();
ads_point pt;
// ??è?ò???μ?
if (acedgetpoint(null, "\npick a point: ", pt) == rtnorm) {
// è?1?μ?μ?ò???μ?£??ò?ìd?
completeeditorcommand();
m_strxpt.format("%g", pt[x]);
m_strypt.format("%g", pt[y]);
m_strzpt.format("%g", pt[z]);
displaypoint();
} else {
// è?1???ódμ?μ?ò???μ?£?è?°′??esc?ü£??ò?d??ó|ó?3ìdòμ??′dd.
canceleditorcommand();
}
}
清高手指点!!
谢谢!
我认为问题不在这里,你的对话框是不是mfc中的?如果是从cdialog中派生过来的,请改正,应该用cacuidialog,也就是把所有的cdiglog用cacuidialog代替
调用一下showwindow(sw_hide);
支持2樓看法.
谢谢支持
就是2的看法 在消息映射时一定要以cacuidialog为基类,否则成为非模式对话框。
你跟我一样,只把类的继承改成 cacuidialog
而忘下改下边的消息循环
begin_message_map(newdlg, cacuidialog)
//{{afx_msg_map(newdlg)
on_bn_clicked(idc_button1, onbutton1)
//}}afx_msg_map
end_message_map()


所有的时间均为北京时间。 现在的时间是 05:47 PM.