Alter funktionierender Code:
Code: Alles auswählen
typedef CHAR (__stdcall *CTINIT)(USHORT,USHORT);
LPCSTR szCT_init = "CT_init";
HMODULE hCtapiLib = 0x0;
CTINIT CT_init = NULL;
hCtapiLib = LoadLibrary("ctcym.dll");
if(hCtapiLib == NULL)
{
cout << "Couldn't load ctcym.dll!!!" << endl;
}
else
{
cout << "SUCCESS: ctcym.dll loaded!!!"<<endl;
}
cout << "test1" << endl;
CT_init = (CTINIT)(GetProcAddress(hCtapiLib,szCT_init));
Code: Alles auswählen
this->ctLib = new QLibrary("C:/Windows/system32/ctcym.dll");
qDebug() << this->ctLib->fileName() << this->ctLib->load() << this->ctLib->isLoaded()<< this->ctLib->errorString();
if(!this->ctLib->resolve("CT_init")) // hier stürzt er schon ab!
{
qDebug() << "cant resolve symbol!!";
}
typedef char (*CTINIT)(unsigned int,unsigned int);
CTINIT CT_init = (CTINIT) this->ctLib->resolve("CT_init");
EDIT:
this->ctLib ist ein QLibrary Pointer als Klassenmember