qt加載dll時 dll與qt項目編譯器必須是同一個。
同時qt用QLibrary方式是動態加載。就是如果你沒有用到dll裏面的東西它不會直接加載。
const char* temp = "D:\\Users\\pautoenr.dll";
//HINSTANCE hDLL = LoadLibrary(L"D:\\Users\\myrootkit.dll");
QLibrary myLib("D:\\Users\\myrootkit.dll");
MyPrototype myFunction = (MyPrototype)myLib.resolve("Min");
if (myFunction)
int q=myFunction(1,2);
//if (!myLib)
//{
// QMessageBox::warning(0, "Title", "Error Message");
//}