- 积分
- 0
- 明经币
- 个
- 注册时间
- 2012-4-26
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
static UINT Test(LPVOID lparam) // static DWORD WINAPI Test(LPVOID lparam)
{
Acad::ErrorStatus es = eNotImplementedYet;
TCHAR file[][255] = {_T("E:\\caddata_2012\\a.dwg"),
_T("E:\\caddata_2012\\b.DWG"),
_T("E:\\caddata_2012\\c.DWG")
};
// es = acDocManager->lockDocument(curDoc(), AcAp::kWrite, NULL, NULL, true);
for (int i = 0; i < 3; i++)
{
CString strFPath(*(file + i));
// 获取数据库
AcDbDatabase* pDatabase = new AcDbDatabase(Adesk::kFalse);
es = pDatabase->readDwgFile(*(file + i)/*strFPath.GetBuffer(0)*/);//eNoInputFiler
es = pDatabase->saveAs(strFPath.GetBuffer(0));
if (pDatabase != NULL)
{
delete pDatabase;//crash 3
pDatabase = NULL;
}
}
// es = acDocManager->unlockDocument(curDoc());
return 1;
}
// - ForTest.MyT command (do not rename)
static void ForTestMyT(void)
{
// Add your code for command ForTest.MyT here
Acad::ErrorStatus es = eNotImplementedYet;
AfxBeginThread(Test, NULL);
// CreateThread(NULL, NULL, Test, NULL, NULL, NULL);
// TCHAR file[][255] = {_T("E:\\caddata_2012\\288-100-2-05.dwg"),
// _T("E:\\caddata_2012\\288-100-4-03.DWG"),
// _T("E:\\caddata_2012\\288-100-4-04.DWG")
// };
//
// es = acDocManager->lockDocument(curDoc(), AcAp::kWrite, NULL, NULL, true);
// for (int i = 0; i < 3; i++)
// {
// CString strFPath(*(file + i));
// // 获取数据库
// AcDbDatabase* pDatabase = new AcDbDatabase(Adesk::kFalse);
// es = pDatabase->readDwgFile(/**(file + i)*/strFPath.GetBuffer(0));
//
// es = pDatabase->saveAs(strFPath.GetBuffer(0));
// if (pDatabase != NULL)
// {
// delete pDatabase;//crash 3
// pDatabase = NULL;
// }
// }
// es = acDocManager->unlockDocument(curDoc());
}
} ;
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CForTestApp)
ACED_ARXCOMMAND_ENTRY_AUTO(CForTestApp, ForTest, MyT, MyT, ACRX_CMD_TRANSPARENT, NULL)
使用cad2012加载编出来的arx
这段代码用vs2010+arx2012 编出来在虚拟机里面加载时cad会提示兼容性的问题,运行的时候没什么问题。但是编出release版本在真机里面依然会有兼容性的提示,而且在运行时会发生异常...
有人清楚是怎么回事么?
先谢谢了哈
|
|