I am using QtCreator to build the application

The DLL is built using VS and it is working as it has to. There are no problems with the dll

My task is to, use the DLL, get the array of bytes from it, and display it.

I had tried the same thing, but instead of array of bytes, i had to get a string from a different DLL.

the code for that is shown in my earlier post.

I tried using QByteArray but i am getting only 1 character return. I dont know if its working or some sort of bug in the code.

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