Jeddite
11th November 2010, 11:48
Hello.
Need help.
I try to use external dll in my application. Code is..
QLibrary lib("c:/lib.dll");
if(lib.load())
qDebug("\n Library is loaded \n");
else
qDebug ("\n Library is not loaded \n");
typedef int (*MyPrototype)(char*,char* ,char*,char*,char *);
MyPrototype myFunction = (MyPrototype) lib.resolve("func");
if (myFunction){
int tmp = myFunction("qwe","qwe","qwe","qwe","qwe");
qDebug("Library start,tmp =%d", tmp);
}
Function signature in the external dll is:
int WINAPI func(const char*,const char*,const char*,const char*,const char*)
Everything work fine if i compile my application in debug mode, but if i try to compile in release and run, program send exception "The instruction at.... The memory could not be "read"". This happens then a try call myFunction(.....). What i`m doing wrong?
Thanks.
PS
Sorry for my english.
Need help.
I try to use external dll in my application. Code is..
QLibrary lib("c:/lib.dll");
if(lib.load())
qDebug("\n Library is loaded \n");
else
qDebug ("\n Library is not loaded \n");
typedef int (*MyPrototype)(char*,char* ,char*,char*,char *);
MyPrototype myFunction = (MyPrototype) lib.resolve("func");
if (myFunction){
int tmp = myFunction("qwe","qwe","qwe","qwe","qwe");
qDebug("Library start,tmp =%d", tmp);
}
Function signature in the external dll is:
int WINAPI func(const char*,const char*,const char*,const char*,const char*)
Everything work fine if i compile my application in debug mode, but if i try to compile in release and run, program send exception "The instruction at.... The memory could not be "read"". This happens then a try call myFunction(.....). What i`m doing wrong?
Thanks.
PS
Sorry for my english.