我执行一个对象,被告之是灾难性失败,错误是编号是:8000ffff?为什么???

dida200 2001-06-28 08:33:09
...全文
296 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dida200 2001-06-30
  • 打赏
  • 举报
回复
能否把楼上的洋文翻译一下,给全分,小妹的洋文不好?
dida200 2001-06-30
  • 打赏
  • 举报
回复
我把我的整个过程说一下:
我有一个api的函数(一个.dll),但是该api不能注册,所以我就些了一个控件,用vc写的ocx,在该控件中使用api的方法和属性,我把该控件注册后,再asp程序中使用,使用asp的server.creatobject()语句来使用,先测试,我用err对象去接受,就出现那种错误.
hydnoahark 2001-06-30
  • 打赏
  • 举报
回复
出现这个错误号的情况有好几种,你是在什么情况下出现的?
hehongyu2000 2001-06-30
  • 打赏
  • 举报
回复
更正: 控制牵制-->控件包容
hehongyu2000 2001-06-30
  • 打赏
  • 举报
回复
以下是大致翻译, 希望有所帮助.

摘要
在当一个OLE容器不支持控制牵制时, 你可能要用一个OLE控件作为一个自动机服务器去使用它的属性和方法. 这篇文章解释在你要用一个OLE控件作为一个正常的自动机服务器时需要做的修改.

详细信息
早于Visual C++ 4.0, 一个OLE 控件就能够在不用任何修改的情况下被用作一个自动机服务器. 不管怎样, 在MFC4.0中, Idispath::Invoke的实现框架是调用虚函数 IsInvokeAllowed去判断, 如果一个CcmdTarget::IsInvokeAllowed函数返回TRUE, 意味着这个服务器能处理自动调用.
在一个OLE控件的情况下, 在用ColeControl::IsInvokeAllowed检查看是否这个这个控件已经通过持久储存接口被初始化或被合适的载入. 如果这个控件有合适的状态信息, 然后这个函数返回TRUE. 当一个OLE控件被创建作为一个正常的自动机服务时, 它不是被创建作为一个客户端的嵌入控件. 因此, 没有一个持久状态初始值出现, 因此导致IsInvokeAllowed去返回FALSE. 这个操作的结果是当在调用自动机对象的方法时, 会生成一个运行时错误(8000ffffJ): “灾难性错误”.

为了去用一个OLE控件作为一个自动机服务器是, 你需要去重载 ColeControl:IsInvokeAllowed()函数并让函数返回TRUE. 如果控件在被作为一个自动机服务器被调用时, 任何这个控件中不能被进入的属性和方法, 将被跳过和/或者在ColeControl::m_bInitialized是FALSE时返回一个错误代码.
tripofdream 2001-06-29
  • 打赏
  • 举报
回复
是何对象?关注!
hehongyu2000 2001-06-29
  • 打赏
  • 举报
回复
我在MSDN里找到一篇用OLE Control as an Automation Server是产生致命错误的文章,
不知是否对你有帮助.

SUMMARY
In situations where an OLE container doesn't support control containment, you may want to use an OLE control as an automation server to gain access to its properties and methods. This article explains the necessary modifications you need to make in order for an OLE control to function as a normal automation server.



MORE INFORMATION
Prior to Visual C++ 4.0, an OLE Control could be used as an automation server without any modification. However, in MFC 4.0, the framework's implementation of IDispatch::Invoke calls the virtual function IsInvokeAllowed to determine if an automation server is in the appropriate state to handle automation calls. The default implementation in CCmdTarget::IsInvokeAllowed returns TRUE, implying that a server can handle automation calls.

In the case of an OLE control, COleControl::IsInvokeAllowed checks to see if the control has been either initialized or loaded properly through the persistent storage interfaces. If the control has the appropriate state information, then this function returns TRUE. When an OLE control is created as a normal automation server, it is not created as an embedding in the client. Hence, none of the persistent state initialization will take place, which thereby causes IsInvokeAllowed to return FALSE. The effect of this is that a call to an automation object method generates a run-time error of (8000ffff) : "Catastrophic failure".

In order to use an OLE control only as an automation server, you need to override COleControl::IsInvokeAllowed() and return TRUE. If any of the control's properties and methods should not be accessed when invoked as a normal automation server, then that automation function could be bypassed and/or an error code can be returned when COleControl::m_bInitialized is FALSE.

tonnycncn 2001-06-28
  • 打赏
  • 举报
回复
罕见的错误!
关注!

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧