srohit24
22nd April 2009, 06:02
Hi
I have a working code that can get a string from a DLL built in VS.
void Dialog::myFunction1()
{
QLibrary *loadLibrary = new QLibrary("sample_for_rohit");
loadLibrary->load();
if (loadLibrary->isLoaded() == false)
qDebug()<<"error not loaded";
else
qDebug()<<"loaded";
typedef char* (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) QLibrary::resolve("sample_for_rohit", "TestDll");
char *b = myFunction();
ui->dispEdit->setText(b);
}
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
I have a working code that can get a string from a DLL built in VS.
void Dialog::myFunction1()
{
QLibrary *loadLibrary = new QLibrary("sample_for_rohit");
loadLibrary->load();
if (loadLibrary->isLoaded() == false)
qDebug()<<"error not loaded";
else
qDebug()<<"loaded";
typedef char* (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) QLibrary::resolve("sample_for_rohit", "TestDll");
char *b = myFunction();
ui->dispEdit->setText(b);
}
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