- UID
- 3272
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-3-23
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2002-4-23 10:48:02
|
显示全部楼层
调试错误
//
// ObjectARX defined commands
#include "StdAfx.h"
#include "StdArx.h"
#include "MMDlg.h"
#include "Maindlg.h"
#include "TjDlg.h"
//CMaindlg* dlg;
extern "C" HWND adsw_acadMainWnd();
//执行主窗口的函数,加载出现错误:
// unhandle Exception E06D7363(e06d7363h)at address 7800A6FFh
// This is command 'TZGL'
void CLcxcadtzgl()
{
CDatabase m_db;
m_db.Open( "tzglxt" );
CString m_sreg1, m_sreg2, m_sreg3;
m_sreg1 = (m_db.GetDatabaseName()).Left(15) + "drdwg\\regsvr32.exe";
m_sreg2 ="/s " + (m_db.GetDatabaseName()).Left(15) + "drdwg\\drdwg.ocx";
m_sreg3 = " /u /s" + (m_db.GetDatabaseName()).Left(15) + "drdwg\\drdwg.ocx";
ShellExecute(NULL, "open", m_sreg1, m_sreg2, NULL, SW_SHOWNORMAL);
Sleep(2000);
CMMdlg dlg;
dlg.DoModal();
dlg.Getparam(&m_db);
if( dlg.DoModal() == IDOK && dlg.Returnparam() != 0 )
{
CMaindlg Maindlg;
Maindlg.Getparam( &m_db, dlg.Returnparam() );
Maindlg.DoModal();
}
ShellExecute(NULL, "open", m_sreg1, m_sreg3, NULL, SW_SHOWNORMAL);
m_db.Close();
}
//删除一些,仍有错,死机退出
// This is command 'TZGL'
void CLcxcadtzgl()
{
CMaindlg Maindlg(CWnd::FromHandle(adsw_acadMainWnd()));
Maindlg.DoModal();
}
我便检查CMaindlg类的初始化函数
BOOL CMaindlg::OnInitDialog()
{
CAcUiDialog::OnInitDialog();
m_bmp.LoadBitmap( IDB_BITMAP1 );
HBITMAP m_hbmp = (HBITMAP) m_bmp.GetSafeHandle();
m_cbt9.SetBitmap(m_hbmp );
AcDbDatabase *pDb = acdbCurDwg();
pDb->saveAs( ((*m_pdb).GetDatabaseName()).Left(15)
+ "dwg\\" + "temp.dwg" ); //有问题
if( m_nmm == 1 )
{
m_cbt2.EnableWindow( TRUE );
m_cbt3.EnableWindow( TRUE );
}
CMaindlg::SetTimer( 1, 100, NULL ); //有问题
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
删除一些,出现主窗口
BOOL CMaindlg::OnInitDialog()
{
CAcUiDialog::OnInitDialog();
// m_bmp.LoadBitmap( IDB_BITMAP1 );
// HBITMAP m_hbmp = (HBITMAP) m_bmp.GetSafeHandle();
// m_cbt9.SetBitmap(m_hbmp );
// AcDbDatabase *pDb = acdbCurDwg();
// pDb->saveAs( ((*m_pdb).GetDatabaseName()).Left(15)
// + "dwg\\" + "temp.dwg" ); //有问题
// if( m_nmm == 1 )
// {
m_cbt2.EnableWindow( TRUE );
m_cbt3.EnableWindow( TRUE );
// }
// CMaindlg::SetTimer( 1, 100, NULL ); //有问题
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
双击“产品选择”出现异常“UnHandle Exception c00005 at address 5f442857h” 死机退出
检查CCpxzDlg 类
BOOL CCpxzDlg::OnInitDialog()
{
CAcUiDialog::OnInitDialog();
CCpSet m_rs(m_pdb);
m_rs.Open(AFX_DB_USE_DEFAULT_TYPE,"CP");
while (!m_rs.IsEOF())
{
m_clb1.AddString ( m_rs.m_CPMC );
m_rs.MoveNext();
}
m_rs.Close();
m_clb1.SetCurSel( 0 );
m_clb1.SetFocus();
if( m_nmm == 1 )
{
m_cbt1.EnableWindow( TRUE );
m_cbt2.EnableWindow( TRUE );
m_cbt3.EnableWindow( TRUE );
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
} |
|