在开发中有时候会遇到WSERV 9 的错误,自己查了一下资料!
在SDK中是这样说的:(wserv是一个窗口服务器)
WSERV ,The window server runs continuously and brings the machine down if it
crashes, so it cannot panic its own thread when it detects an error in one of
its client’s requests. Instead it panics the client’s thread using CSession::Panic()
. These panics have a category of WSERV.
而wserv 9 的错误是这样解释的:
试图用一个非活动图形上下文。
一个绘图请求发送到一个图形上下文当上下文不活跃。
在服务器端,这种恐慌是提出CWsGc::CommandL()
对所有收到的请求时,上下文不除积极EWsGcOpActivate
, EWsGcOpDeactivate
, EWsGcOpFree
和EWsGcOpTestInvariant
。
根据我自己写的程序,我总结可能是因为在不能调用 CWindowGc& gc = SystemGc(); 这个语句的函数内调用了这个语句所造成的 。