LoadLibray returns 0 when I'm trying to load a dll file. I'm using Visual Studio 2017
#include "App.h"
#include <windows.h>
#include <iostream>
using namespace std;
typedef int(__stdcall *f_funci)(unsigned char, unsigned int);
int main(int argc, char **argv) {
SetDllDirectory((LPCWSTR)L"C:\\xmrig-master\\build\\Debug");
HINSTANCE hGetProcIDDLL = LoadLibrary(L"asm.dll");
if (!hGetProcIDDLL) {
cout << "could not load the dynamic library" << endl;
//return EXIT_FAILURE;
}else{
cout << "cy" << endl;
}
/*
f_funci assemblerMode = (f_funci)GetProcAddress(hGetProcIDDLL, "asm");
if (!assemblerMode) {
cout << "could not locate the function " << assemblerMode << GetLastError() << endl;
//return EXIT_FAILURE;
}
cout << "assemblerMode() returned " << assemblerMode(1,0) << endl;
//*/
App app(argc, argv);
return app.exec();
}