×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Lightbulb IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Can any one tell me asap ????wat is right way to call createBit main function in ContainerViewApp..


    is it like ????

    CreateBitmapL(_L("$(EPOCROOT)epoc32\data\z\resource\apps\BlackMiniSet.mbm"), blue1.bmp);

    Thanks in Advace

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Note that your application run in the emulator sees the "$(EPOCROOT)epoc32\data\z" as "Z:\", so try removing the beginning part of the path.

  3. #3
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    sir , i know that actully i wann run on emulator first so SI there is nay problen to call CreateBitmapL(_L("$(EPOCROOT)epoc32\data\z\resource\apps\BlackMiniSet.mbm"), like this ..actuuly sir i'm slightly confuse to call function pointer so i wann right way to call this function

    Thank you gentelman

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    It is wrong:
    - $(EPOCROOT) is macro expansion which works in makefiles and in the .pkg file (when you use the SIS builder of Carbide.c++). It can not be used in C++ code
    - the z: drive of the emulator is that "z" folder, thus $(EPOCROOT), epoc32, data are not necessary anyway
    - backslash is an escape character in C/C++ (and in several other languages), so you are using non-existing characters like '\d' or '\B', and some existing, but improper ones, like '\r'
    It should be _L("z:\\resource\\apps\\BlackMiniSet.mbm").

  5. #5
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Thank you sir, and Is it right to call CreateBitMap(_L("z:\\resource\\apps\\BlackMiniSet.mbm"),blue1.bmp)???????

    Actully CreateBitMap is funtion pointer type and how it will use????

    IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    already define in .h file and .lib also include then err is createBitmap is undefined??

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    "blue1.bmp" in C++ code? No, it is not. As a first try you could write 0.

  7. #7
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Undefined identifier 'createBitMap'??? after includede .lib or .h how we remove it?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Actually I have not used it, but it is a method of CEikonEnv (it is not inside your class), so you can invoke it as CEikonEnv::Static()->CreateBitmapL(...), perhaps iEikonEnv->CreateBitmapL may also work.

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Quote Originally Posted by SymbianSangeet View Post
    Undefined identifier 'createBitMap'??? after includede .lib or .h how we remove it?
    Are you sure using the correct function? Did you define it your own becuase there is no such function I could find in the SDK help.
    Nokia Developer Wiki Moderation team

  10. #10
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    On this line now i get 3 err

    CEikonEnv::Static()->CreateBitmapL(_L("z\resource\apps\BlackMiniSet.mbm"),EMbmBlackminisetBlue1);


    1->Creation Time Description Resource Path Location Type
    1277336724359 identifier 'CEikonEnv::Static()' redeclared BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem
    2->Creation Time Description Resource Path Location Type
    1277336724375 was declared as: 'CEikonEnv * ()' BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem
    3->Creation Time Description Resource Path Location Type
    1277336724406 now declared as: 'int ()' BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem
    in SDK you can see CreateBitmapL function...

    now sir wat to do? to sove these err

    Thanks gentelmen

  11. #11
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Quote Originally Posted by SymbianSangeet View Post
    On this line now i get 3 err

    CEikonEnv::Static()->CreateBitmapL(_L("z\resource\apps\BlackMiniSet.mbm"),EMbmBlackminisetBlue1);
    I believe Wizard has said you about escape character in the post #4. Change your path accordingly.

    Now about the actual error, can you show that whole function whereever you use CEikonEnv::Static()?

    Also search for CreateBitmapL on Forum Nokia Wiki where you may get some articles.
    Nokia Developer Wiki Moderation team

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    This redeclared stuff probably means that you are out of any method scope, that is why the compiler says you are redeclaring the method.

  13. #13
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    /*
    ========================================================================
    Name : BlackMiniSetContainerView.cpp
    Author : Arun Tyagi
    Copyright : Your copyright notice
    Description :
    ========================================================================
    */
    // [[[ begin generated region: do not modify [Generated System Includes]
    #include <aknviewappui.h>
    #include <eikmenub.h>
    #include <avkon.hrh>
    #include <akncontext.h>
    #include <akntitle.h>
    #include <stringloader.h>
    #include <barsread.h>
    #include <eikbtgpc.h>
    #include <BlackMiniSet.rsg>
    #include <eikenv.h>
    #include <w32std.h>
    #include "BlackMiniSet.mbg"

    // ]]] end generated region [Generated System Includes]

    // [[[ begin generated region: do not modify [Generated User Includes]

    #include "BlackMiniSet.hrh"
    #include "BlackMiniSetContainerView.h"
    #include "BlackMiniSetContainer.h"
    // ]]] end generated region [Generated User Includes]

    // [[[ begin generated region: do not modify [Generated Constants]
    // ]]] end generated region [Generated Constants]

    /**
    * First phase of Symbian two-phase construction. Should not contain any
    * code that could leave.
    */
    CBlackMiniSetContainerView::CBlackMiniSetContainerView()
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    iBlackMiniSetContainer = NULL;
    // ]]] end generated region [Generated Contents]

    }

    /**
    * The view's destructor removes the container from the control
    * stack and destroys it.
    */
    CBlackMiniSetContainerView::~CBlackMiniSetContainerView()
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    delete iBlackMiniSetContainer;
    iBlackMiniSetContainer = NULL;
    // ]]] end generated region [Generated Contents]

    }
    //CEikonEnv *iBitmap;
    CEikonEnv::Static()->CreateBitmapL(_L("z\resource\apps\BlackMiniSet.mbm"),EMbmBlackminisetBlue1);

    /**
    * Symbian two-phase constructor.
    * This creates an instance then calls the second-phase constructor
    * without leaving the instance on the cleanup stack.
    * @return new instance of CBlackMiniSetContainerView
    */
    CBlackMiniSetContainerView* CBlackMiniSetContainerView::NewL()
    {
    CBlackMiniSetContainerView* self = CBlackMiniSetContainerView::NewLC();
    CleanupStack::Pop(self);
    return self;
    }

    /**
    * Symbian two-phase constructor.
    * This creates an instance, pushes it on the cleanup stack,
    * then calls the second-phase constructor.
    * @return new instance of CBlackMiniSetContainerView
    */
    CBlackMiniSetContainerView* CBlackMiniSetContainerView::NewLC()
    {
    CBlackMiniSetContainerView* self = new ( ELeave ) CBlackMiniSetContainerView();
    CleanupStack::PushL( self );
    self->ConstructL();
    return self;
    }


    /**
    * Second-phase constructor for view.
    * Initialize contents from resource.
    */
    void CBlackMiniSetContainerView::ConstructL()
    {
    // [[[ begin generated region: do not modify [Generated Code]
    BaseConstructL( R_BLACK_MINI_SET_CONTAINER_BLACK_MINI_SET_CONTAINER_VIEW );

    // ]]] end generated region [Generated Code]

    // add your own initialization code here

    }

    /**
    * @return The UID for this view
    */
    TUid CBlackMiniSetContainerView::Id() const
    {
    return TUid::Uid( EBlackMiniSetContainerViewId );
    }

    /**
    * Handle a command for this view (override)
    * @param aCommand command id to be handled
    */
    void CBlackMiniSetContainerView::HandleCommandL( TInt aCommand )
    {
    // [[[ begin generated region: do not modify [Generated Code]
    TBool commandHandled = EFalse;
    switch ( aCommand )
    { // code to dispatch to the AknView's menu and CBA commands is generated here
    default:
    break;
    }


    if ( !commandHandled )
    {

    if ( aCommand == EAknSoftkeyExit )
    {
    AppUi()->HandleCommandL( EEikCmdExit );
    }

    }
    // ]]] end generated region [Generated Code]

    }

    /**
    * Handles user actions during activation of the view,
    * such as initializing the content.
    */
    void CBlackMiniSetContainerView:oActivateL(
    const TVwsViewId& /*aPrevViewId*/,
    TUid /*aCustomMessageId*/,
    const TDesC8& /*aCustomMessage*/ )
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    SetupStatusPaneL();


    if ( iBlackMiniSetContainer == NULL )
    {
    iBlackMiniSetContainer = CreateContainerL();
    iBlackMiniSetContainer->SetMopParent( this );
    AppUi()->AddToStackL( *this, iBlackMiniSetContainer );
    }
    // ]]] end generated region [Generated Contents]

    }

    /**
    */
    void CBlackMiniSetContainerView:oDeactivate()
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    CleanupStatusPane();

    if ( iBlackMiniSetContainer != NULL )
    {
    AppUi()->RemoveFromViewStack( *this, iBlackMiniSetContainer );
    delete iBlackMiniSetContainer;
    iBlackMiniSetContainer = NULL;
    }
    // ]]] end generated region [Generated Contents]

    }


    /**
    * Handle status pane size change for this view (override)
    */
    void CBlackMiniSetContainerView::HandleStatusPaneSizeChange()
    {
    CAknView::HandleStatusPaneSizeChange();

    // this may fail, but we're not able to propagate exceptions here
    TVwsViewId view;
    AppUi()->GetActiveViewId( view );
    if ( view.iViewUid == Id() )
    {
    TInt result;
    TRAP( result, SetupStatusPaneL() );
    }

    // [[[ begin generated region: do not modify [Generated Code]
    // ]]] end generated region [Generated Code]

    }

    // [[[ begin generated function: do not modify
    void CBlackMiniSetContainerView::SetupStatusPaneL()
    {
    // reset the context pane
    TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
    CEikStatusPaneBase::TPaneCapabilities subPaneContext =
    StatusPane()->PaneCapabilities( contextPaneUid );
    if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
    {
    CAknContextPane* context = static_cast< CAknContextPane* > (
    StatusPane()->ControlL( contextPaneUid ) );
    context->SetPictureToDefaultL();
    }

    // setup the title pane
    TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
    CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
    StatusPane()->PaneCapabilities( titlePaneUid );
    if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned())
    {
    CAknTitlePane* title = static_cast< CAknTitlePane* >(
    StatusPane()->ControlL( titlePaneUid ) );
    TResourceReader reader;
    iEikonEnv->CreateResourceReaderLC( reader, R_BLACK_MINI_SET_CONTAINER_TITLE_RESOURCE );
    title->SetFromResourceL( reader );
    CleanupStack::PopAndDestroy(); // reader internal state
    }

    }

    // ]]] end generated function

    // [[[ begin generated function: do not modify
    void CBlackMiniSetContainerView::CleanupStatusPane()
    {
    }

    // ]]] end generated function

    /**
    * Creates the top-level container for the view. You may modify this method's
    * contents and the CBlackMiniSetContainer::NewL() signature as needed to initialize the
    * container, but the signature for this method is fixed.
    * @return new initialized instance of CBlackMiniSetContainer
    */
    CBlackMiniSetContainer* CBlackMiniSetContainerView::CreateContainerL()
    {
    return CBlackMiniSetContainer::NewL( ClientRect(), NULL, this );
    }

  14. #14
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    90

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    CEikonEnv::Static()->CreateBitmapL(_L("z\resource\apps\BlackMiniSet.mbm"),EMbmBlackminisetBlue1); at this line we get 3 err ..

    1->Creation Time Description Resource Path Location Type
    1277489396671 identifier 'CEikonEnv::Static()' redeclared BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem

    2->Creation Time Description Resource Path Location Type
    1277489396703 was declared as: 'CEikonEnv * ()' BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem


    3->Creation Time Description Resource Path Location Type
    1277489396718 now declared as: 'int ()' BlackMiniSetContainerView.cpp BlackMiniSet/src line 60 C/C++ Problem
    how i sove these err give me some hint

    thank you

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: IMPORT_C CWsBitmap *CreateBitmapL(const TDesC &aFileName, TInt aId);

    Yes, this is what I thought: you have written that line in the middle of nowhere, out of any method body.
    Otherwise are you aware of that this line would return with a bitmap handle (that CWsBitmap*)), which is supposed to be stored in some variable?
    And it is your View class, where you could not use bitmaps either.
    Have such member variable in the Container class (which inherits from CCoeControl), and initialize the variable in its ConstructL method, via storing this pointer - of course the filename-constant still needs the fixes discussed days ago in this thread.
    Then you can try BitBlt-ing it in the Draw method.

Similar Threads

  1. How to use MAHLEGenericAPI* NewAHLEClientL(const TDesC& aDatabaseName)?
    By princesse_sahara in forum Symbian Tools & SDKs
    Replies: 15
    Last Post: 2009-07-29, 05:46
  2. Replies: 4
    Last Post: 2008-08-07, 11:35
  3. Problem with const TDesC& aUri
    By doesitmatter in forum Symbian
    Replies: 4
    Last Post: 2007-11-19, 21:36
  4. How to Convert Tint to const TDesC& ?
    By HidayathKhan in forum Symbian
    Replies: 6
    Last Post: 2007-10-17, 13:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×