I wen't to the Project's build options, clicked on the Linker tab, and added --export-all-symbols, and it still didn't work. I've also made sure I haven't misspelled the function name for GetProcAddress, so that can't be it.
The function looks like this:
DLL_EXPORT LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam) {
// my code here.
}
and here is the code that trys to load it:
dllInst = LoadLibrary("loader.dll");
if (dllInst != NULL) {
cbtProc = (HOOKPROC) GetProcAddress(dllInst, "CBTProc");
if (cbtProc != NULL) {
cbtHook = SetWindowsHookEx(WH_CBT, cbtProc, dllInst, tId);
}
}