×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Rajkot
    Posts
    430

    how to pass whole array data through function into another class?

    Hi

    i like to pass whole array data Appui to DBMSEngine through make function
    please give me suggetion

    if String data like to pass than we use
    const TDesC& CXMLParsingAppUi::Name()
    {
    return iName; // TBuf<15> iName, declaration in header file;
    }

    but what can i write if using array???

    Regards
    Tanya

  2. #2
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: how to pass whole array data through function into another class?

    Hi In the case of array....

    CDesC16Array* CXMLParsingAppUi::Name()
    {
    iArrDesName=new(ELeave)CDesC16Array(5);
    ///////
    /// Use here.....

    return iArrDesName; // return here array....
    }

    I think, It would work for u.

  3. #3
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: how to pass whole array data through function into another class?

    you can also declare array in the appui as public and can access bu static cast.

    CDesCArrayFlat* iDataName;//public in appui.h
    iDataName = new (ELeave) CDesCArrayFlat(1);//constructL in appui.cpp

    if(iDataType)//in distructor in appui
    {
    delete iDataType;
    iDataType = NULL;
    }


    //access like this anywhere and you did not need to return any value from the function.

    ((AppUi*)(CCoeEnv::Static()->AppUi()))->iDataName
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  4. #4
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Rajkot
    Posts
    430

    Re: how to pass whole array data through function into another class?

    it's give me an error like: 'AppUi' : undeclared identifier

    i write code following way:

    CXMLParsingAppUi.h
    --------------------
    public:
    CDesCArrayFlat* iarrName;

    CXMLParsingAppUi.cpp
    --------------------
    iarrName = new (ELeave) CDesCArrayFlat(1);
    iarrName->AppendL( *colname );

    DBMSEngine.cpp
    ---------------
    void CBookDb::CreateBooksTableL()
    {
    ((AppUi*)(CCoeEnv::Static()->AppUi()))->iarrName;
    ....
    ....
    ....
    }

  5. #5
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: how to pass whole array data through function into another class?

    write this
    ((CXMLParsingAppUi*)(CCoeEnv::Static()->AppUi()))->iarrName; instead of

    ((AppUi*)(CCoeEnv::Static()->AppUi()))->iarrName;

    hope this will work now.

    for testing purpose you can take TBuf<20> iarrName onstead of CDesCArrayFlat* iarrName;

    hope this will help you.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  6. #6
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Rajkot
    Posts
    430

    Re: how to pass whole array data through function into another class?

    ya i use same way and also include header file
    #include <coemain.h>

    but give me a same error.

  7. #7
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: how to pass whole array data through function into another class?

    did you include XMLParsingAppUi.h

    hope this will fine now.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

Similar Threads

  1. copying descriptor data into descriptor array
    By bballbeng in forum Symbian
    Replies: 4
    Last Post: 2006-09-07, 10:21
  2. GPRS connection problems on 6600..
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2005-12-02, 14:00
  3. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  4. Class and function to open an APN
    By pappago in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2002-10-21, 09:14

Posting Permissions

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