明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5455|回复: 4

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

[复制链接]
发表于 2006-5-12 20:57:00 | 显示全部楼层 |阅读模式

当用AcdbObject::upgradeOpen()将一个层表记录改为 kforwrite时,提示Acad::eHadMultipleReaders,无法改变其读写的状态

只有用->close()函数关闭层表记录,再执行upgradeOpen() ,操作成功。

是不是运用upgradeOpen() 前必须关闭对象呢?

但是我在另外一个工程中却没有这样的问题,不解!请高手指教,呵呵。。。

发表于 2006-5-12 23:28:00 | 显示全部楼层

Acad::ErrorStatus

upgradeOpen();

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.
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.

Note  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.

注意这个函数中的说明 If the object has more than one reader, then the open status is not changed and Adesk::eHadMultipleReaders is returned

 楼主| 发表于 2006-5-13 12:28:00 | 显示全部楼层

没有啊,层表记录只有在获得层表记录时以kForRead模式打开的,然后马上用upgradeOpen()函数将其改为kForWrite状态。应该是没有问题的。

还有一个问题是:同是这个程序,放在另外一个工程中并没有这样的问题,百思不得其解。

发表于 2006-5-13 17:47:00 | 显示全部楼层

不好意思,我是现在还是菜鸟,还有很多的问题不懂呢....

望有达人们来解决吧

发表于 2006-5-16 13:21:00 | 显示全部楼层

我还未为达人,建议看看帮助文件

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-29 16:46 , Processed in 0.172232 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表