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.
loadLibrary->load();
if (loadLibrary->isLoaded() == false)
qDebug()<<"error not loaded";
else
qDebug()<<"loaded";
MyPrototype myFunction
= (MyPrototype
) QLibrary::resolve("sample",
"TestDll");
char *b = ba.data();
ui->dispEdit->setText(b);
QLibrary *loadLibrary = new QLibrary("sample_for_rohit");
loadLibrary->load();
if (loadLibrary->isLoaded() == false)
qDebug()<<"error not loaded";
else
qDebug()<<"loaded";
typedef QByteArray (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) QLibrary::resolve("sample", "TestDll");
QByteArray ba = myFunction();
char *b = ba.data();
ui->dispEdit->setText(b);
To copy to clipboard, switch view to plain text mode
Bookmarks