[EMAIL PROTECTED] schrieb: > Hello, > > I'm embedding Python interpreter in a Win32 console application. I use > C++. > > I would like to use the WinAPI LoadLibrary function to load the python > dll at runtime (followed by GetProcAddress calls), so that I have to > make no assumptions about the location of the dll. > > However I can't use the macro Py_DECREF if I load the dll this way. > > Is there a way to properly free python objects (specifically - > dictionaries created by PyDict_New() and the object returned by > PyRun_String()) not using Py_DECREF? > > Alternatively, is there a way to include the python header - to make > the macro Py_DECREF available, but to be able to locate the python dll > whenever python is installed? > > (The problem is that python may be installed anywhere, and the python > dll does not always appear in system folders - sometimes it is in the > python installation directory, thus it is unclear which targets to > specify to the linker to search for the dll).
Use the Py_DecRef function, which was added for exactly this purpose. Thomas -- http://mail.python.org/mailman/listinfo/python-list