sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\misc\t_destruct2.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include "t_destruct.h" sl@0: sl@0: class TTestObjectDynamic sl@0: { sl@0: public: sl@0: TTestObjectDynamic(); sl@0: ~TTestObjectDynamic(); sl@0: }; sl@0: sl@0: TTestObjectDynamic GlobalObjectWithDestructor; sl@0: sl@0: void Panic(TInt aReason) sl@0: { sl@0: User::Panic(_L("t_destruct_dll2"), aReason); sl@0: } sl@0: sl@0: TTestObjectDynamic::TTestObjectDynamic() sl@0: { sl@0: RDebug::Printf("t_destruct_dll2 constructor called\n"); sl@0: TInt r; sl@0: RMsgQueue messageQueue; sl@0: r = messageQueue.OpenGlobal(KMessageQueueName); sl@0: if (r != KErrNone) sl@0: Panic(r); sl@0: r = messageQueue.Send(EMessageConstructDynamic); sl@0: if (r != KErrNone) sl@0: Panic(r); sl@0: messageQueue.Close(); sl@0: } sl@0: sl@0: TTestObjectDynamic::~TTestObjectDynamic() sl@0: { sl@0: RDebug::Printf("t_destruct_dll2 destructor called\n"); sl@0: TInt r; sl@0: RMsgQueue messageQueue; sl@0: r = messageQueue.OpenGlobal(KMessageQueueName); sl@0: if (r != KErrNone) sl@0: Panic(r); sl@0: r = messageQueue.Send(EMessageDestructDynamic); sl@0: if (r != KErrNone) sl@0: Panic(r); sl@0: messageQueue.Close(); sl@0: } sl@0: sl@0: EXPORT_C void DynamicMain() sl@0: { sl@0: }