- UID
- 91433
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-11-2
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我用VC++ AppWizard 生成一个对话框,要在上面进行一些处理,有一个功能需要用鼠标在屏幕上选取一个点,我建立了一个按钮,在按钮的实现代码如下:
// Hide the dialog and give control to the editor
BeginEditorCommand();
ads_point pt;
// Get a point
if (acedGetPoint(NULL, "\n请选取一个点: ", pt) == RTNORM)
{
// If the point is good, continue
CompleteEditorCommand();
m_posX = pt[X];
m_posY = pt[Y];
UpdateData(FALSE);
}
else
{
// otherwise cancel the command (including the dialog)
CancelEditorCommand();
}
对话框我已改成 CAcUiDialog 派生
建立对话框的语句是
CDlgTest dlg(CWnd::FromHandle(adsw_acadMainWnd()));
dlg.DoModal() ;
结果运行时,没有反应,点其它按钮退出对话框时整个CAD都被关掉了,上面的代码我是参照 帮助的例子上写的,请问要实现这个功能还需要怎么改动?
另外 例子中 OnInitDialog() 中调用的 DLGCTLINFO 等代码是起什么作用?必须要写嘛? 控件间的数据不能用 UpdateData 函数来传递嘛? DisplayXXX 等函数为什么那么写,必须每个控件都要写嘛? |
|