musicplayer_plat/mpx_music_store_api/inc/mpxfindinmusicshop.inl
changeset 0 ff3acec5bc43
child 2 b70d77332e66
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ECOM inline loading file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32base.h>
       
    22 #include <ecom/ecom.h>  
       
    23 #include "mpxfindinmusicshop.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CMPXFindInMShop::~CMPXFindInMShop
       
    29 // Standard virtual destructor
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CMPXFindInMShop::~CMPXFindInMShop()
       
    33       {
       
    34       REComSession::DestroyedImplementation( iDtorKey );
       
    35       }
       
    36           
       
    37 // -----------------------------------------------------------------------------
       
    38 // CMPXFindInMShop::CMPXFindInMShop
       
    39 // C++ default constructor can NOT contain any code, that
       
    40 // might leave.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CMPXFindInMShop* CMPXFindInMShop::NewL()
       
    44     {
       
    45     // Create the ecom implementation
       
    46     // plugin dll must reside in ROM in order to be loaded!
       
    47     //
       
    48     CMPXFindInMShop* imp = NULL;
       
    49     RImplInfoPtrArray plugins;
       
    50     REComSession::ListImplementationsL( KSchemeHandlerDefinitionUid, plugins );
       
    51     TInt err = KErrNotFound;
       
    52     for( TInt i=0; i<plugins.Count(); ++i )
       
    53         {
       
    54         CImplementationInformation* info = plugins[i];
       
    55         if( info->RomBased() )
       
    56             {
       
    57             err = KErrNone;
       
    58             TUid uid = info->ImplementationUid();    
       
    59             imp = reinterpret_cast<CMPXFindInMShop*>
       
    60                 ( REComSession::CreateImplementationL( uid, _FOFF( CMPXFindInMShop, iDtorKey ) ) );
       
    61             break;
       
    62             }
       
    63         }
       
    64     User::LeaveIfError( err );
       
    65     plugins.ResetAndDestroy();
       
    66     plugins.Close();
       
    67     return imp;
       
    68     }
       
    69     
       
    70 //  End of File