alfalfa 发表于 2006-5-12 20:57:00

AcdbObject::upgradeOpen()出现的问题!

<P>当用AcdbObject::upgradeOpen()将一个层表记录改为 kforwrite时,提示Acad::eHadMultipleReaders,无法改变其读写的状态</P>
<P>只有用-&gt;close()函数关闭层表记录,再执行upgradeOpen() ,操作成功。</P>
<P>是不是运用upgradeOpen() 前必须关闭对象呢?</P>
<P>但是我在另外一个工程中却没有这样的问题,不解!请高手指教,呵呵。。。</P>

HuaiYu 发表于 2006-5-12 23:28:00

<P>Acad::ErrorStatus</P>
<P>upgradeOpen();</P>
<P>If the object is currently open AcDb::kForRead with only one reader, then this function upgrades the object to open AcDb::kForWrite. In the process of changing to open for write, the object is closed, thus triggering any pertinent notification.<BR>Returns Acad::eOk if successful. If the object has more than one reader, then the open status is not changed and Adesk::eHadMultipleReaders is returned. If the object is already open AcDb::kForWrite, then Acad::eWasOpenForWrite is returned. If the object is currently sending notification, then the open status is not changed and Acad::eWasNotifying is returned.</P>
<P>Note&nbsp; A call of this function does not need to be matched with a call to downgradeOpen(), since a call to close() or cancel() will sufficiently cleanup the entity抯 open state.</P>
<P>注意这个函数中的说明 If the object has more than one reader, then the open status is not changed and Adesk::eHadMultipleReaders is returned</P>

alfalfa 发表于 2006-5-13 12:28:00

<P>没有啊,层表记录只有在获得层表记录时以kForRead模式打开的,然后马上用upgradeOpen()函数将其改为kForWrite状态。应该是没有问题的。</P>
<P>还有一个问题是:同是这个程序,放在另外一个工程中并没有这样的问题,百思不得其解。</P>

HuaiYu 发表于 2006-5-13 17:47:00

<P>不好意思,我是现在还是菜鸟,还有很多的问题不懂呢....</P>
<P>望有达人们来解决吧</P>

zghua 发表于 2006-5-16 13:21:00

<P>我还未为达人,建议看看帮助文件</P>
页: [1]
查看完整版本: AcdbObject::upgradeOpen()出现的问题!