Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User joysweet's Avatar
    Join Date
    Mar 2006
    Posts
    42
    我没有使用codewarrior的模板,自建了一个空白的工程,但是模拟器中一运行到返回new CEikApplication时就会报Reason code :user Reason number:23,奇怪.

    1.JReader.cpp
    Code:
    #include "JReader.h"
    
    EXPORT_C CApaApplication* NewApplication()
    {
    	return new CReader_Application;
    	//return NULL;
    }
    GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
    {
    	return KErrNone;
    }
    2.JReader.h
    Code:
      #ifndef __JReader_H
    #define __JReader_H
    
    #include <e32std.h>
    #include <apparc.h>
    #include <qikdocument.h>
    #include <eikapp.h>
    #include <qikdocument.h>
    #include <qikapplication.h>
    #include <qikappui.h>
    #include <eikappui.h>
    #include <eikenv.h>
    #include <coecntrl.h>
    #include <bautils.h>
    #include <barsread.h>
    #include <JREADER.rsg>
    #include "JREADER.hrh"
    #include <BARSREAD.h>
    #include <eikmenup.h>
    //UIQ APPLICATION
    class CReader_Application : public CQikApplication
    {
    	
    	TUid AppDllUid() const;
    	CApaDocument* CreateDocumentL();
    };
    
    //UIQ DOCUMENT
    class CReader_Document : public CQikDocument
    {
    	//constructor
      public:
    	CReader_Document(CReader_Application& aApp);
      private:	
    	CEikAppUi* CreateAppUiL();
    	
    };
    
    //UIQ APPUI
    class CReader_AppUi : public CQikAppUi
    {
    	public :
    		void ConstructL();
    		~CReader_AppUi();
    	//	void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
    	private:
    		void HandleCommandL(TInt aCommand);
    		
    };
    
    class CReader_AppView : public CCoeControl
    {
    	public:
    		static CReader_AppView* NewL(const TRect& aRect);
    		~CReader_AppView();
    		void ConstructL(const TRect& aRect);
    	private:
    		void Draw(const TRect& aRect) const;
    };
    
    
    #endif;
    3.JReader_Application
    Code:
    #include "JReader.h"
    
    const TUid KUidJReader = {0X101F74A8};
    
    TUid CReader_Application::AppDllUid() const
    {
    	return KUidJReader;
    }
    
    
    CApaDocument* CReader_Application::CreateDocumentL(){
    	return new(ELeave) CReader_Document(*this);
    	//return NULL;
    }
    4.JReader_AppUi
    Code:
    #include "JReader.h"
    
    void CReader_AppUi::ConstructL(){
      BaseConstructL();
    }
    
    CReader_AppUi::~CReader_AppUi()
    {
    
    }
    
    void CReader_AppUi::HandleCommandL(TInt aCommand){
    	switch(aCommand){
    		case 0:
    			Exit();
    			break;
    	}
    }
    5.JReader_Document
    Code:
    #include "JReader.h"
    
    CReader_Document::CReader_Document(CReader_Application& aApp) :CQikDocument(aApp)
    {
    	  
    
    	
    }
    
    CEikAppUi* CReader_Document::CreateAppUiL(){
    	return new (ELeave) CReader_AppUi;
    }
    6.JReader_AppView
    Code:
    #include "JReader.h"
    
    static CReader_AppView* NewL(const TRect& aRect){
    	CReader_AppView* self = new(ELeave) CReader_AppView();
    	CleanupStack::PushL(self);
    	self->ConstructL(aRect);
    	CleanupStack::Pop();
    	return self;
    }
    
    void CReader_AppView::ConstructL(const TRect& aRect){
    	CreateWindowL();
    	SetRect(aRect);
    	ActivateL();
    	
    }
    
    void CReader_AppView::Draw(const TRect& aRect) const{
    	
    }
    7.JReader.rss
    Code:
    // Simple.RSS
    //
    // Copyright (c) 1997-2002 Symbian Ltd.  All rights reserved.
    //
    
    NAME JRAD
    
    #include <eikon.rh>
    #include <eikcore.rsg>
    #include <qikon.rh>
    #include <aiftool.rh>
    #include "JReader.hrh"
    
    
    RESOURCE AIF_DATA
    {
    // captions
     caption_list=
      { 
      CAPTION { code=ELangEnglish; caption="Hello"; },
      CAPTION { code=ELangFrench; caption="Bonjour"; }
      };
    }
    Last edited by joysweet; 2006-04-06 at 09:15. Reason: 请帮忙看一下这个错是为啥?请指点,不甚感激

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved