GetProcAddress function in C++
Hello guys: I've loaded my DLL in my project but whenever I use the GetProcAddress function. it returns NULL! what should I do? I use this function ( double GetNumber(double x) ) in "MYDLL.dll" Here is a code which I used: typedef double (*LPGETNUMBER)(double Nbr); HINSTANCE hDLL = NULL; LPGETNUMBER lpGetNumber; hDLL = LoadLibrary(L"MYDLL.DLL"); lpGetNumber = (LPGETNUMBER)GetProcAddress((HMODULE)hDLL, "GetNumber"); Checking return codes and calling GetLastError() will set you free. You should be checking return codes twice here. You are actually checking return codes zero times. hDLL =