高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
但原因不详
|