几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】cad系统变量的研究 (http://www.dimcax.com/hust/showthread.php?t=6214)

yang686526 2009-04-16 09:39 AM

【转帖】cad系统变量的研究
 
cad系统变量的研究
cad系统变量的研究
我写了如下的代码 目的是读取userr1系统变量的参数 编译也没问题 ,运行后会中断 调试了一下 userr1的值根本没有被psysrb获取 不知为何? 还请懂得朋友指点一下
struct resbuf * psysrb ;
cstring str;
acedgetvar(_t("userr1"),psysrb);
str.format(_t("%d"),psysrb->resval.rreal);
ads_printf(str);
acutrelrb(psysrb);
解决了 原来是不能定义成struct resbuf * psysrb ,不能用指针
帮助里有一段话:
warning the result argument must point to an allocated resbuf (it can be static, automatic, or dynamically allocated). it must not be declared as just a pointer
但原因不详


所有的时间均为北京时间。 现在的时间是 10:20 AM.