Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    Hi, I could hide my application by this codeSymbian C++ s6)


    CEikonEnv::Static()->RootWin().EnableReceiptOfFocus(EFalse);
    CEikonEnv::Static()->RootWin().SetOrdinalPosition(-1000, ECoeWinPriorityNeverAtFront);


    Now, I do not know how can I show it again, because the Symbian focus is located on another app after Set Ordinal.
    Could you please help me for finding a solution?
    it is important to me that my app appears with a specific code like #123 ...
    If you know better way I would appreciate help me.

    Thanks

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    try searching for threads talking about CaptureKey, or check wiki for exmaples. Then when you capture the key, just use the SetOrdinalPosition to bring your app back to teh front(that also should have wiki exmaple, as well as loads of old discussion threads).

  3. #3
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    Thanks for your reply.

    I have just found a class as you can check here:

    " http://wiki.forum.nokia.com/index.ph...ui_application "

    Then I have added this class to my app as CKeyCapture class and when I am writing this code :

    CKeyCapture* MyKey = new CKeyCapture;

    in MyAppUi::ConstructorL()

    I have an error like "Error : CKeyCapture :no appropriate default constructor available "
    Could you please help me for getting the point. ?

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    try it like:

    CKeyCapture* MyKey = new(ELeave)CKeyCapture();

  5. #5
    Nokia Developer Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,308
    Try to do like this:

    in MyAppUi.h
    Code:
    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack 
        {
        ...
        ...
        private:
           CKeyCapture* iMyKey;
        ...
        }
    in MyAppUi.h cpp in MyAppUi::ConstructorL()
    Code:
    iMyKey = CKeyCapture::NewL( this );

  6. #6
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    Thanks for your reply.

    it does not work, and shows me some errors like :

    error C2065: 'iMyKey' : undeclared identifier
    \SRC\MYappui.cpp(79) : error C2664: 'NewL' : cannot convert parameter 1 from 'class MYAppUi *const ' to 'class MKeyCallBack &'

    Thanks,

  7. #7
    Nokia Developer Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,308
    Are you sure that you have already declared iMyKey in the header file?

  8. #8
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    also your appui is not derived from MKeyCallBack

  9. #9
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    Yes, but I have this one as well:

    "Error : Can not parameter 1 from class CCapKey2AppUI *const to class MKCallBack&"

    Thanks,
    Arvin

  10. #10
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    consider reading #8

  11. #11
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    I have just added

    In MyAppUi.h

    class CKeyCapture;

    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack
    {
    public:

    void ConstructL();

    protected:

    private:

    CKeyCapture* iMyKey;

    };


    in MyAppUi.cpp file

    void CCapKey2AppUi::ConstructL()
    {
    iMyKey = CKeyCapturer::NewL(this);
    }


    but I have the error that I was saying to you.

    Thanks
    Arvin

  12. #12
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    try like this iMyKey = CKeyCapture::NewL( *this );

  13. #13
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    It does not work and it gives me :

    error " C2440 :'=' cannot convert from class CKeyCapture* to CKeyCapture*"


    sorry for bothering you.

    thanks

  14. #14
    Registered User ArvinShahidi's Avatar
    Join Date
    Jul 2009
    Posts
    20
    Is it possible that I send you my App by email ?

  15. #15
    Nokia Developer Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,308
    Check class names that you are using:
    Quote Originally Posted by ArvinShahidi View Post
    I have just added

    In MyAppUi.h

    class CKeyCapture;

    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack
    {
    public:

    void ConstructL();

    protected:

    private:

    CKeyCapture* iMyKey;

    };


    in MyAppUi.cpp file

    void CCapKey2AppUi::ConstructL()
    {
    iMyKey = CKeyCapturer::NewL(this);
    }
    If you use class from this article ( http://wiki.forum.nokia.com/index.ph...ui_application ) then add to your MyAppUi.h

    Code:
    #include "KeyCapturer.h"
    ...
    
    class CCapKey2AppUi : public CAknAppUi, public MKeyCallBack
    {
    private:
           // from MKeyCallBack
           void KeysMap(const TDesC& keys);  
    ...
    private:
    
    	CKeyCapturer* iMyKey;
    }
    in MyAppUi.cpp file
    Code:
    void CCapKey2AppUi::ConstructL()
    {
    ...
    iMyKey = CKeyCapturer::NewL(*this);
    }
    
    void CCapKey2AppUi::KeysMap(const TDesC& keys)
    {
    // handle event
    }
    Last edited by A.A.M.; 2009-07-15 at 16:11.

Page 1 of 2 12 LastLast

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