请教:用C++开发ACAD,如何实现非模式(无模式)对话框?
Don't forget: Set the "visible" of the dialog as true(property)
1、定义一个新类,这个类是从CDialog继承,(先插入一个对话框,然后用向导定义一个新类2、对这个类增加承员函数
afx_msg LONG CMDwg::onAcadKeepFocus( UINT, LONG )
{
//return FALSE;
return TRUE;
}
3、为这个类增加消息
BEGIN_MESSAGE_MAP(CMDwg, CDialog)
//{{AFX_MSG_MAP(CMDwg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
ON_MESSAGE( WM_ACAD_KEEPFOCUS, onAcadKeepFocus )
END_MESSAGE_MAP()
4定义startdlg() 和enddlg全局函数
BOOL startDlg()
{
BOOL b = TRUE;
if(!gpDlg)
{
CAcModuleResourceOverride resOverride;
gpDlg = new CBoundAngle(acedGetAcadFrame());
b = gpDlg->Create(IDD_DIALOG10 );
}
return b;
}
//
//
//
BOOL endDlg()
{
if(!gpDlg)
return TRUE;
BOOL b = gpDlg->DestroyWindow();
if(b)
gpDlg = NULL;
return b;
}
5、用startdlg启动对话框
6、用enddlg关闭对话框
void CMDwg::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
CDialog::OnClose();
endDlg();
}
i see, thanks!
Re 请斑竹介绍一下,无模式对话框与acad的交互,文档锁定的专题好吗?
OK,Give me some time
页:
[1]