关于打开文件对话框
请问怎样实现打开文件的对话框啊?我用CFileDialog不能显示..... 把你的代码贴上来看看。另外,可以参考下面的代码(来自帮助文件中的例子):
AcDbObjectId transId;<BR> AcDbDatabase* pDb;<BR> char *fname;<BR> struct resbuf *rb;
// Get a dwg file from the user.<BR> //<BR> rb = acutNewRb(RTSTR);<BR> int stat = acedGetFileD("Pick a drawing", NULL, "dwg", 0, rb);<BR> <BR> if ((stat != RTNORM) || (rb == NULL)) {<BR> acutPrintf("\nYou must pick a drawing file.");<BR> return;<BR> }
// Allocates a region of memory large enough to hold an object whose <BR> // size is returned by acad_msize().<BR> fname = (char*)acad_malloc(strlen(rb->resval.rstring) + 1);<BR> strcpy(fname, rb->resval.rstring);<BR> acutRelRb(rb);<BR> <BR> // Open the dwg file.<BR> //<BR> pDb = new AcDbDatabase(Adesk::kFalse);<BR> if (pDb->readDwgFile(fname) != Acad::eOk) {<BR> acutPrintf("\nSorry, that draing is probably already open.");<BR> return;<BR> }
页:
[1]