Symbian进程间通信 消息队列
2010-07-21 04:17:00 来源:WEB开发网_LIT(KGlobalQName, "GlobalMsgQ");
RMsgQueue
TInt ret = msgqueue.OpenGlobal(KGlobalQName);
if (ret == KErrNone)
{
//Using Receive(), returns "KErrUnderflow" if queue is empty
TInt msgfrmq;
ret = msgqueue.Receive(&msgfrmq);
//Using ReceiveBlocking()
msgqueue.ReceiveBlocking(&msgfrmq);
}
Other Queue Properties
Other member functions inherited from RHandleBase are as follows:
* CancelDataAvailable()
Cancels an outstanding data available notification request.
* CancelSpaceAvailable()
Cancels an outstanding space available notification request.
* KMaxLength
Gets the size of message slots in the queue.
* MessageSize()
Gets the size of message slots in the queue.
* NotifyDataAvailable()
Requests notification when there is at least one message in the queue. A thread can have only one data available notification request outstanding on this message queue. If a second request is made before the first request completes, then the calling thread is panicked.
* NotifySpaceAvailable()
Requests notification when space becomes available in the queue. This is an asynchronous request that completes when there is at least one 'slot'available in the queue.
* Open()
Opens a global message queue using a handle passed in a server message.
* OpenGlobal()
Opens a global message queue using the name of the message queue.
更多精彩
赞助商链接