Symbian3/SDK/Source/GUID-D69DD425-5F93-4238-A7E9-915F24A9C9CA.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-D69DD425-5F93-4238-A7E9-915F24A9C9CA" xml:lang="en"><title>Open
C MessageQueue Library Example</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The Message Queue Library example demonstrates how to use Open C APIs for
developing applications that use Open C standard libraries on Symbian platform.
This example uses the APIs of the message queue library to create/close message
queues and send/receive messages and also get information on created message
queues. </p>
<section id="GUID-026FD8D6-6C4A-5958-B289-775D4AE1E756-GENID-1-10-1-11-1-1-5-1-3-1-11-1-12-1-2-2"><title>Download</title> <p>Click
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-9db026cc-ac23-4593-8bbc-4b251c085d4f.zip" scope="external"> opencmessagequeuelibraryex.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-9db026cc-ac23-4593-8bbc-4b251c085d4f.html" scope="peer">browse</xref> to view the example code. </p> </section>
<section id="GUID-7E7C4564-B10E-41F9-8A9D-D8A6C5E9C51C-GENID-1-10-1-11-1-1-5-1-3-1-11-1-12-1-2-3"><title>Design and
Implementation</title> <p>The following sections provide information about
the implementation of the example. </p><p><b>Description</b></p><p>OpenCMessageQueueClientEx
is a C Application that uses the  Message Queue library. This application
uses main() as the entry point for the application. This is a simple console
based application. The application uses Message Queue library (OpenCMessageQueueLibrary.dll)
APIs.  The Main thread of the application creates two message queues, and
two threads. Thread one will send message to message queue 1 and waits for
messages from message queue 2. Then thread one will send message to message
queue 2 and waits for messages from message queue 1. If a user tries to create
a message queue using OpenCMessageQueueLibrary.dll with the already
existing name, it will just return the existing message queue Id. The application
has its own icon and can be launched from the UI both in the emulator  and
in the device. </p><p><b>Capabilities</b> </p> The program capabilities are
defined in:  <filepath>MessageQueueLibrary.mmp</filepath> (DLL - library):<codeph> CAPABILITY
ALL -TCB</codeph> <filepath>MessageQueueClient.mmp</filepath>(EXE - application): <codeph>CAPABILITY
NONE</codeph>. <p><b>Module hierarchy</b> </p>This application has 2 modules
as below:  <p>Message Queue Library (DLL) that exports set of apis for the
user.</p><p>OpenCMessageQueueLibraryEx\engine : The application (EXE) that
demonstrates the usage of Open C APIs and also those APIs exported by Message
Queue Library.</p><p> (OpenCMessageQueueLibraryEx\exe) : This example will
create a DLL which exports set of generic APIs with which the user can do
message queue related operations.   To give a rough idea on how to use these
apis, an EXE is provided that creates threads and does send/receive on message
queues using those exported apis.</p><p><b>APIs used</b></p><p>msgget </p><p> msgctl
 </p><p>msgrcv  </p><p>msgsnd  </p><p>semget  </p><p>semctl </p><p> semop </p> </section>
<section id="GUID-67A72761-1D92-46D1-B1C9-7455978BDE4E-GENID-1-10-1-11-1-1-5-1-3-1-11-1-12-1-2-4"><title>Building and
Using</title> To build the Message Queue Library example application, go to
the <filepath>OpenCMessageQueueLibraryEx\group</filepath> directory and build
the application.  The Message Queue Library application consists of two modules,
which should be built in the following order:   engine - which builds the
generic message queue library  exe - which builds an EXE that demonstrates
the usage of this library  The definition for the whole application can be
found in the<filepath>bld.inf</filepath>in the group subdirectory of the applications
main directory. </section>
</conbody></concept>