acedGetEnv和acedSetEnv函数使用!!!
<p>有人用过acedGetEnv和acedSetEnv函数吗?</p><p>我怎么使用都不行,是不是ARX中声明了没有实现哦???????</p> <p class="signature">extern "C" int acedGetEnv(const ACHAR * sym,ACHAR * var);</p><table class="argumentList"><tbody><tr valign="baseline"><td class="argumentName">sym</td><td class="argumentDescription">Input environment variable name to get, which is case sensitive in all environments (Visual LISP, ObjectARX, and VB/ActiveX)</td></tr><tr valign="baseline"><td class="argumentName">var</td><td class="argumentDescription">Output preallocated buffer to be filled in with environment variable value (a buffer size of 1024 bytes should be sufficient)</td></tr></tbody></table><p>Retrieves the value of an environment variable. Looks first in the AutoCAD-specific FixedProfile/General section of the registry:<br/></p><pre>HKEY_CURRENT_USERSoftware
Autodesk
AutoCAD
R15.0
<Install ID>
FixedProfile
General</pre><br/>If an entry is not found in the registry, retrieves the value from the Windows system environment table. <p></p><p>Note This function will not work for AutoCAD sysvars. For AutoCAD sysvars, use <a href="mk:@MSITStore:C:\ObjectARX%202008\docs\arxref.chm::/Globals/AcEd/acedGetVar.htm">acedGetVar()</a>.</p><p>If acedGetEnv() succeeds, it returns RTNORM; otherwise it returns RTERROR. This function is the complement of the <a href="mk:@MSITStore:C:\ObjectARX%202008\docs\arxref.chm::/Globals/AcEd/acedSetEnv.htm">acedSetEnv()</a> function.</p><h2>Include File</h2><p>acedads.h
</p><p>这段是帮助文档的话,说的很清楚了,这是得对应注册表的键值。如果要得系统变量用acedGetVar,不清楚你为什么要用这个函数,肯定是实现了的,不可能没实现。</p> <p>那你的意思就是如果我想获得CAD中的系统变量和改变CAD的系统变量只有通过注册表了是不是?</p><p>那ARX中还定义这两个函数干什么呢?</p> <p>参考这个帖:)</p><p><a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=58568&replyID=&skin=1">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=58568&replyID=&skin=1</a></p><p>我们这样用这些涵数的,</p><p>示例代码如下:<br/>struct resbuf cmd, rb1,rb2 , *dxf;<br/> ads_name Ename;<br/> ads_point pt1 ;<br/> int m,n,k;<br/> //acedGetVar("osmode", & os);<br/> cmd.restype = RTREAL;<br/> cmd.resval.rreal = 0;<br/> acedSetVar("cmdecho", &cmd);//(SETVAR "CMDECHO" 0)<br/></p> <p>可是这是acedGetVar,和acedGetEnv的声明不一样哦</p>
页:
[1]