musicplayer_plat/mpx_music_store_api/inc/mpxfindinmusicshop.inl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:45:05 +0200
changeset 0 ff3acec5bc43
child 2 b70d77332e66
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "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:
*
* Description:  ECOM inline loading file
*
*/



// INCLUDE FILES
#include <e32base.h>
#include <ecom/ecom.h>  
#include "mpxfindinmusicshop.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CMPXFindInMShop::~CMPXFindInMShop
// Standard virtual destructor
// -----------------------------------------------------------------------------
//
CMPXFindInMShop::~CMPXFindInMShop()
      {
      REComSession::DestroyedImplementation( iDtorKey );
      }
          
// -----------------------------------------------------------------------------
// CMPXFindInMShop::CMPXFindInMShop
// C++ default constructor can NOT contain any code, that
// might leave.
// -----------------------------------------------------------------------------
//
CMPXFindInMShop* CMPXFindInMShop::NewL()
    {
    // Create the ecom implementation
    // plugin dll must reside in ROM in order to be loaded!
    //
    CMPXFindInMShop* imp = NULL;
    RImplInfoPtrArray plugins;
    REComSession::ListImplementationsL( KSchemeHandlerDefinitionUid, plugins );
    TInt err = KErrNotFound;
    for( TInt i=0; i<plugins.Count(); ++i )
        {
        CImplementationInformation* info = plugins[i];
        if( info->RomBased() )
            {
            err = KErrNone;
            TUid uid = info->ImplementationUid();    
            imp = reinterpret_cast<CMPXFindInMShop*>
                ( REComSession::CreateImplementationL( uid, _FOFF( CMPXFindInMShop, iDtorKey ) ) );
            break;
            }
        }
    User::LeaveIfError( err );
    plugins.ResetAndDestroy();
    plugins.Close();
    return imp;
    }
    
//  End of File