I'm having trouble with loading a DLL in my assignment project.
Here's the header file:
I have omitted code that works and is irrelevant to the problem. Basically, hinstLib is not NULL but when the line Filter = (FILTPTR) GetProcAddress(hinstLib, "Filter"); is executed, Filter has no value. To me it seems like it is saying that the DLL has been found but it cannot find the function "Filter" inside the DLL and I have no idea why, albeit I could be wrong. I still haven't got my head around how some of this works.
Here is the DLL:
Any ideas anyone? All help is greatly appreciated!
- James
Your specifiers are wrong. A good, concise way do to this is to use same header to in DLL and APP, defining the export-import interface., which uses macro like this:
And declarations:
Library's .cpp file would use this header and would define MY_DLL_EXPORTS.
If I understand your code right, you made it so that linker tries to export same function from both modules? ALso, function's prototype should be C-compatible to be actually
extern "C"