我是纯业余的(可能问题都说不明白)
我用ObjectARX使用MFC编写了几个对话框,写了一些语句,想把计算结果直接输出到CAD模型空间中。
当我把 “ CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);” 放到acrxEntryPoint.cpp中时,没有问题,可以正常输出计算结果。
而当我把 “ CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);” 放到void CWELCOME::OnYb754()时,程序调试无错误,当CAD加载程序运行时出现中断。系统显示“acad.exe 中的 0x6458bd80 处最可能的异常: 0xC0000005: 读取位置 0x00000004 时发生访问冲突”
“下面的框架可能不正确或缺失,没有为acdb17.dll加载符号”。错误的位置就在“ pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();”
AcDbObjectId CCreateTuKuang::CreateMText(const AcGePoint3d& ptInsert,const ACHAR* text, AcDbObjectId style,double height, double width)
{
AcDbMText *pMText = new AcDbMText();
// 设置多行文字的特性
pMText->setTextStyle(style);
pMText->setContents(text);
pMText->setLocation(ptInsert);
pMText->setTextHeight(height);
pMText->setWidth(width);
pMText->setAttachment(AcDbMText::kTopMid); return CCreateTuKuang::PostToModelSpace(pMText);}AcDbObjectId CCreateTuKuang::Create1MText(const AcGePoint3d& ptInsert,const ACHAR* text, AcDbObjectId style,double height, double width)
{
AcDbMText *pMText = new AcDbMText();
// 设置多行文字的特性
pMText->setTextStyle(style);
pMText->setContents(text);
pMText->setLocation(ptInsert);
pMText->setTextHeight(height);
pMText->setWidth(width);
pMText->setAttachment(AcDbMText::kTopMid); return CCreateTuKuang::PostToModelSpace(pMText);}void CWELCOME::OnYb754()
{
// TODO: 在此添加命令处理程序代码
//防止资源冲突
CAcModuleResourceOverride resOverride; CENTERYB75TJNUM Enteryb75TjNumDlg; if(Enteryb75TjNumDlg.DoModal()==IDOK)
{
m_Yb75_TjNum=Enteryb75TjNumDlg.m_Yb75_TjNum;
} DJZ();//自定义函数 CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);
}
我用ObjectARX使用MFC编写了几个对话框,写了一些语句,想把计算结果直接输出到CAD模型空间中。
当我把 “ CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);” 放到acrxEntryPoint.cpp中时,没有问题,可以正常输出计算结果。
而当我把 “ CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);” 放到void CWELCOME::OnYb754()时,程序调试无错误,当CAD加载程序运行时出现中断。系统显示“acad.exe 中的 0x6458bd80 处最可能的异常: 0xC0000005: 读取位置 0x00000004 时发生访问冲突”
“下面的框架可能不正确或缺失,没有为acdb17.dll加载符号”。错误的位置就在“ pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();”
AcDbObjectId CCreateTuKuang::CreateMText(const AcGePoint3d& ptInsert,const ACHAR* text, AcDbObjectId style,double height, double width)
{
AcDbMText *pMText = new AcDbMText();
// 设置多行文字的特性
pMText->setTextStyle(style);
pMText->setContents(text);
pMText->setLocation(ptInsert);
pMText->setTextHeight(height);
pMText->setWidth(width);
pMText->setAttachment(AcDbMText::kTopMid); return CCreateTuKuang::PostToModelSpace(pMText);}AcDbObjectId CCreateTuKuang::Create1MText(const AcGePoint3d& ptInsert,const ACHAR* text, AcDbObjectId style,double height, double width)
{
AcDbMText *pMText = new AcDbMText();
// 设置多行文字的特性
pMText->setTextStyle(style);
pMText->setContents(text);
pMText->setLocation(ptInsert);
pMText->setTextHeight(height);
pMText->setWidth(width);
pMText->setAttachment(AcDbMText::kTopMid); return CCreateTuKuang::PostToModelSpace(pMText);}void CWELCOME::OnYb754()
{
// TODO: 在此添加命令处理程序代码
//防止资源冲突
CAcModuleResourceOverride resOverride; CENTERYB75TJNUM Enteryb75TjNumDlg; if(Enteryb75TjNumDlg.DoModal()==IDOK)
{
m_Yb75_TjNum=Enteryb75TjNumDlg.m_Yb75_TjNum;
} DJZ();//自定义函数 CString outStr14;
outStr14.Format(_T("%d"),m_Yb75_4DJZ1);
AcGePoint3d ptInsert;
ptInsert.set(112, 257, 0);
CCreateTuKuang::Create1MText(ptInsert,outStr14);
}
解决方案 »
- 用VC6对AVI文件进行操作如何获取当前帧数
- 快圣诞了,借国外的节日祝大家平安!顺便散分!另外提醒大家及时结贴!
- 奉上100分,请各位大虾赐教!!!如何通过IHTMLDocument2 查询到某个IHTMLElement,并激发这个OnClick消息
- 在多文档界面中,如果限制某类型的文档只能打开一个窗口??
- 对话框都关闭了,但是在任务管理器里显示进程还在运行?为什么?
- 老板要我做个类似于Authorware和Flash那样的课件制作系统,教我怎么下手?!
- 如何获取一个字符的大小?
- 问一个文件夹删除的问题
- 100分请教大家一个问题!关于记录主机共享文件被访问情况的问题。
- 急问:vc6如何调用vc5编写的程序?
- MFC问题,请教各位
- MFC dll如何加载ocx插件,并成功调用ocx内部函数
调试能通过,CAD加载程序的时候提示有问题,确实是这里有问题。求解决方法。拜托拜托了。。自学路上异常艰难。