Chinaunix首页 | 论坛 | 博客
  • 博客访问: 22178
  • 博文数量: 28
  • 博客积分: 670
  • 博客等级: 上士
  • 技术积分: 285
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-09 11:27
文章分类

全部博文(28)

文章存档

2011年(28)

我的朋友
最近访客

分类: 嵌入式

2011-01-29 12:37:36

 A stray-event panic from the Active Scheduler ( E32USER-CBASE 46 error ) is a most common problem with an Active Objects. This is ussually caused by one ( or more ) of the following:

1. You forgot to call CActiveScheduler::Add() before starting the Active Object.

2. You dont call SetActive() after issuing an async request.

3. Passing the same iStatus to two service providers at the same time ( multiple requests outstanding on the same Active Object ).

Do not invoke DoCancel() directly - it should be private - always call Cancel(). Note that Cancel() should be always be called in the destructor of your derived class.

Other related pitfalls (triggering other panics)

4. Using your own TRequestStatus variable, instead of using the one provided by CActive.

5. Passing automatic variables when doing an asynchronous request.

一、E32User-CBase 46 Panic 的成因
E32User-CBase 46 的成因除了以下大家熟知的几种情形之外,(参见  )
  1. 忘记将 CActive 对加入 CActiveScheduler;
  2. 在发起异步请求之后忘记调用 SetActive();
  3. 同时有两个或以上的请求使用同一个 iStatus;
  4. 没有使用 CActive 的 iStatus 成员,而是使用了 TRequestStatus 变量;
  5. 在异步请求中发送了自动变量.

AO的最常见用法:
SomeAsyncFunc(iStatus); // 提交请求
SetActive(); // 把自己设为活动状态


阅读(480) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~