看文档, 在你使用acedXXXXX的时候: 1.你的类必须继承于CAdUiXXXX 2.在使用acedXXXXX之前调用BeginEditorCommand() 3.在之后根据成功失败的情况调用CompleteEditorCommand()或CancelEditorCommand(); 文档中有下面的论述: - Add the button handlers for picking a point and angle using the AutoCAD editor. The BeginEditorCommand(), CompleteEditorCommand(), and CancelEditorCommand() functions are used to hide the dialog, allow the call to acedGetPoint and acedGetAngle, and finally, either cancel or redisplay the dialog based on how the user picked:
// AsdkAcUiDialogSample message handlers void AsdkAcUiDialogSample::OnButtonPoint() { // Hide the dialog and give control to the editor // BeginEditorCommand(); ads_point pt; // Get a point // if (acedGetPoint(NULL, "\nPick a point: ", pt) == RTNORM) { // If the point is good, continue // CompleteEditorCommand(); m_strXPt.Format("%g", pt[X]); m_strYPt.Format("%g", pt[Y]); m_strZPt.Format("%g", pt[Z]); DisplayPoint(); } else { // otherwise cancel the command (including the dialog) CancelEditorCommand(); } } |