diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-0CDA8FCA-AABE-5988-9467-30AA1AECCC90.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-0CDA8FCA-AABE-5988-9467-30AA1AECCC90.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,84 @@ + + + + + +Creating +and Deleting a Session: TutorialThis tutorial shows you how to create and delete a session with +the Comms Database. + + +

Before you start, +you must understand:

    +
  • the general concept +of the Comms Database

  • +
  • the specific concept +of Comms Database Sessions

  • +
  • how to write and build +application code to run on Symbian platform

  • +
+

You create a session +with the Comms Database before you start to read and write the data. You can +also set the access attributes for the session.

+ +Include the header +files, define namespaces, and declare constants. + +TheCommsDatTypesV1_1.h header file defines the +classes and API items that the tool or application requires. This header file +includes all other required header files. + +Define the CommsDat namesapce. + +Define a TVersion set with the +version information. + +The location of this code depends on the structure of the tool or application. +#include <CommsDatTypesV1_1.h> + +// Add a declaration like this for each specific version you need. +// In this example, the major version number, the minor version number +// and the build number are all 1. +#define KCDVersion1_1 TVersion(1,1,1) + +using namespace CommsDat; + +... + +Create the session. + +You select the version of the interface when you create the session. +... +// for the version 1.1.1 defined in step 1 +CMDBSession* iDb = CMDBSession::NewL(KCDVersion1_1); +... + +Set the access attributes +for the session. + +This is an optional step. +The following code allows the tool or application to see the elements +that are marked as hidden in the Comms Database. The ECHidden symbol +is an enum value of the TCDAttributeFlags enum. +You can also set the other access attributes, but the hidden attribute is +the most common use case. +... +iDb->SetAttributeMask(ECDHidden); +... + +Delete the session +object after the tool or application has finished its use of the Comms Database +... +delete iDb; + + +
+Comms Database +concepts +
\ No newline at end of file