Results 1 to 6 of 6

Thread: How to get an array of bytes from a DLL?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default How to get an array of bytes from a DLL?

    Hi

    I have a working code that can get a string from a DLL built in VS.

    Qt Code:
    1. void Dialog::myFunction1()
    2. {
    3. QLibrary *loadLibrary = new QLibrary("sample_for_rohit");
    4.  
    5. loadLibrary->load();
    6. if (loadLibrary->isLoaded() == false)
    7. qDebug()<<"error not loaded";
    8. else
    9. qDebug()<<"loaded";
    10.  
    11. typedef char* (*MyPrototype)();
    12. MyPrototype myFunction = (MyPrototype) QLibrary::resolve("sample_for_rohit", "TestDll");
    13. char *b = myFunction();
    14.  
    15. ui->dispEdit->setText(b);
    16. }
    To copy to clipboard, switch view to plain text mode 

    Dataopen is a function inside the dll and hardware_comm is the name of the dll.

    Now i need to access the array of bytes from another DLL. But if I use the same code as in the returning the string, I get a error.
    The error is the just-in-time compiler error.

    I know that the DLL is loaded as i get the loaded msg from qDebug.

    Somehow DLL permits strings but not pointer to arrays(I know its strange because internally it’s the same thing but that’s the way it is!).

    Can anyone help me out in this?

    Thanks
    Last edited by srohit24; 22nd April 2009 at 06:07.

Similar Threads

  1. Phonon issues with DirectSound9
    By Zoltán in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2009, 02:48
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. How many bytes did i send?
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2008, 10:12
  4. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  5. How to construct Image from Bytes
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2007, 05:41

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.