#include <centralrepository.h>
#include <profileenginesdkcrkeys.h>
// Wymagana biblioteka: centralrepository.lib
// ...

// Otwieramy repozytorium.
CRepository* rep = CRepository::NewLC( KCRUidProfileEngine );

// Odczytujemy identyfikator aktywnego profilu.
TInt profil = -1;
User::LeaveIfError( rep->Get( KProEngActiveProfile, profil ) );

CleanupStack::PopAndDestroy( rep );

// Obsugujemy profil.
switch( profil )
    {
    case 0:    // General
        {
        // ...
        }
        break;
    case 1:    // Silent
        {
        // ...
        }
        break;
    case 2:    // Meeting
        {
        // ...
        }
        break;
    case 3:    // Outdoor
        {
        // ...
        }
        break;
    case 4:    // Pager
        {
        // ...
        }
        break;
    case 6:    // Offline
        {
        // ...
        }
        break;
    default:    // Profile uytkownika (30 - 49)
        {
        // ...
        }
    }
