ObjectArx中实现文件选择的代码如下:
static void qxzyGetFileD_SelectFile(void) { // Add your code for command qxzyGetFileD._SelectFile here const ACHAR* title = L"选择图形文件"; const ACHAR* path = L"C:\\"; struct resbuf *fileName; fileName = acutNewRb(RTSTR); if(acedGetFileD(title, path, _T("dwg;dxf"), 0, fileName) == RTNORM) { acedAlert(fileName->resval.rstring); } acutRelRb(fileName); }ACHAR的用法:
第一种定义方法:
const ACHAR* title = L"选择图形文件"; const ACHAR* path = L"C:\\";
第二种定义方法:
ACHAR layerName[40]; if(acedGetString(Adesk::kFalse, _T("请输入图层名:"), layerName) != RTNORM) { return; }
参考文件:http://www.objectarx.net/forum.php?mod=viewthread&tid=1244