Hi, i'm a beginner with SymbianOS-Programming and need some help. i only want to know why this applications doesn't work. Thanks for your help and your advices.
This is my Header-File
/*
============================================================================
Name : SymbianAppContainer.h
Author : Jens Saathoff
Copyright : JS 2006
Description : Declares container control for application.
============================================================================
*/
#ifndef SYMBIANAPPCONTAINER_H
#define SYMBIANAPPCONTAINER_H
// INCLUDES
#include <coecntrl.h>
// FORWARD DECLARATIONS
class CEikLabel; // for example labels
class CEikEdwin;
// CLASS DECLARATION
/**
* CSymbianAppContainer container control class.
*
*/
class CSymbianAppContainer : public CCoeControl, MCoeControlObserver
{
public: // Constructors and destructor
/**
* EPOC default constructor.
* @param aRect Frame rectangle for container.
*/
void ConstructL(const TRect& aRect);
/**
* Destructor.
*/
~CSymbianAppContainer();
public: // New functions
public: // Functions from base classes
private: // Functions from base classes
/**
* From CoeControl,SizeChanged.
*/
void SizeChanged();
/**
* From CoeControl,CountComponentControls.
*/
TInt CountComponentControls() const;
/**
* From CCoeControl,ComponentControl.
*/
CCoeControl* ComponentControl(TInt aIndex) const;
/**
* From CCoeControl,Draw.
*/
void Draw(const TRect& aRect) const;
/**
* From MCoeControlObserver
* Acts upon changes in the hosted control's state.
*
* @param aControl The control changing its state
* @param aEventType The type of control event
*/
void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
private: //data
CEikLabel* iLabel; // example label
CEikLabel* iToDoLabel; // example label
CEikEdwin* iInput;
};
#endif // SYMBIANAPPCONTAINER_H
This my Implementation.(CPP)
/*
============================================================================
Name : SymbianAppContainer.cpp
Author : Jens Saathoff
Copyright : JS 2006
Description : Container control implementation
============================================================================
*/
// INCLUDE FILES
#include "SymbianAppContainer.h"
#include <eiklabel.h> // for example label control
#include <eikedwin.h>
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CSymbianAppContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CSymbianAppContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL( *this );
iLabel->SetTextL( _L("Example View") );
iToDoLabel = new (ELeave) CEikLabel;
iToDoLabel->SetContainerWindowL( *this );
iToDoLabel->SetTextL( _L("Add Your controls\n here") );
iInput = new (ELeave) CEikEdwin;
iInput->SetContainerWindowL(* this);
// iInput->SetExtent(TPoint(10,40), iInput->MinimumSize());
//iInput->DrawNow();
SetRect(aRect);
ActivateL();
}
// Destructor
CSymbianAppContainer::~CSymbianAppContainer()
{
delete iLabel;
delete iToDoLabel;
delete iInput;
}
// ---------------------------------------------------------
// CSymbianAppContainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CSymbianAppContainer::SizeChanged()
{
// TODO: Add here control resize code etc.
iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
iToDoLabel->SetExtent( TPoint(10,100), iToDoLabel->MinimumSize() );
//iInput->SetExtent(TPoint(10,40), iInput->MinimumSize());
}
// ---------------------------------------------------------
// CSymbianAppContainer::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CSymbianAppContainer::CountComponentControls() const
{
return 2; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CSymbianAppContainer::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CSymbianAppContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iLabel;
case 1:
return iToDoLabel;
default:
return NULL;
}
}
// ---------------------------------------------------------
// CSymbianAppContainer:raw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CSymbianAppContainer:raw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbGray );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
}
// ---------------------------------------------------------
// CSymbianAppContainer::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CSymbianAppContainer::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
// TODO: Add your control event handler code here
}
the debug-run starts, if i click on my program icon , my program simply stops with an error: "program closed".
that's all.
sorry for this stupid question, i will get my symbian book this week.
Thank you



raw(const TRect& aRect) const


