My question is going to use examples from Python, but it seems like this could be a general question.
I've been using load-time dynamic linking, but for various reasons (it's recommended in the link below) I'd like to dynamically load the Python library:
HINSTANCE hModPython = LoadLibrary(_T("Python27.dll"));
I'm able to load Py_Initialize
and other functions from the DLL, but it's a dirty process:
int (*pPy_Initialize)(void);
pPy_Initialize = (int (*)(void))GetProcAddress(hModPython, "Py_Initialize");
pPy_Initialize();
In this conversation it's said that:
Macros can make using these pointers transparent to any C code that calls routines in Python’s C API.
My question is really how to do what this writer suggests when I'm going to be importing a wide variety of functions, with various signatures. It would be nice to use the signatures that are already in Python.h (including that header somehow).