Results 1 to 20 of 121

Thread: dynamicCall and QByteArray - strange characters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: dynamicCall and QByteArray - strange characters

    I meant the ArrayList (or its C++ equivalent) or whatever the return type of the call should be.

  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Default Re: dynamicCall and QByteArray - strange characters

    Quote Originally Posted by wysota View Post
    I meant the ArrayList (or its C++ equivalent) or whatever the return type of the call should be.
    Do you mean something like this?
    QList<QString> list = static_cast<QList<QString>>(ba.data()) ?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: dynamicCall and QByteArray - strange characters

    No, I meant the structure you would be getting if you were calling the method directly using WinAPI's COM API. I just can't say it more clearly. Or just dump the byte array to the console in ascii, see what is there and try to guess its stucture.

  4. #4
    Join Date
    Apr 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dynamicCall and QByteArray - strange characters

    Quote Originally Posted by wysota View Post
    No, I meant the structure you would be getting if you were calling the method directly using WinAPI's COM API. I just can't say it more clearly. Or just dump the byte array to the console in ascii, see what is there and try to guess its stucture.
    If I can try to put it a bit more clearly:

    Your dynamic call returns a QByteArray with 441 elements right? So all those return types (CardID, OverWrite, idxDesignation and all those) you listed should be contained in those 441 elements.
    What wysota means by structure is how those 441 elements are divided to produce the return types ie. CardID is a string of size 10, OverWrite a byte(or bit) etc... If you have that structure you can try to cast the QByteArray to that structure. Otherwise you'll need to determine the structure as wysota mentioned - by dumping to ascii and trying to figure out the type of each return type.

  5. #5
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Default Re: dynamicCall and QByteArray - strange characters

    Quote Originally Posted by zAAm View Post
    If I can try to put it a bit more clearly:

    Your dynamic call returns a QByteArray with 441 elements right? So all those return types (CardID, OverWrite, idxDesignation and all those) you listed should be contained in those 441 elements.
    What wysota means by structure is how those 441 elements are divided to produce the return types ie. CardID is a string of size 10, OverWrite a byte(or bit) etc... If you have that structure you can try to cast the QByteArray to that structure. Otherwise you'll need to determine the structure as wysota mentioned - by dumping to ascii and trying to figure out the type of each return type.
    If I well understood I have to first create such structure with struct and then cast the returned value to such structure? Or I'm wrong?
    Can I have some pseudo-code?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: dynamicCall and QByteArray - strange characters

    Quote Originally Posted by franco.amato View Post
    If I well understood I have to first create such structure with struct and then cast the returned value to such structure?
    Did you try entering "ArrayList C++" in your favourite search engine and reading what pops up?

  7. #7
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Default Re: dynamicCall and QByteArray - strange characters

    Quote Originally Posted by wysota View Post
    Did you try entering "ArrayList C++" in your favourite search engine and reading what pops up?
    The arrayList is not the problem. The problem is the return value that's QByteArray
    Franco Amato

Similar Threads

  1. Replies: 0
    Last Post: 16th April 2010, 23:21
  2. Regarding qbytearray
    By mohanakrishnan in forum Qt Programming
    Replies: 7
    Last Post: 19th November 2009, 13:38
  3. Replies: 9
    Last Post: 25th July 2009, 13:27
  4. Replies: 1
    Last Post: 28th May 2008, 16:52
  5. QByteArray in Qt3
    By joseph in forum Qt Programming
    Replies: 1
    Last Post: 6th September 2007, 06:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.