Embedding Python with Dynamic Loading (win)

Michael Geary Mike at DeleteThis.Geary.com
Mon Jan 5 17:49:58 CET 2004


Simon Steele wrote:
> I'm trying to embed python into my application, and have
> everything working fine using the static import lib.
> However, I don't want my application to be dependant on
> python being installed (it's an optional script interpreter).
> Therefore I want to be able to dynamically load python
> instead (which I believe is possible, but I can't find any
> examples for). It seems, however, that the import lib is
> imported in python.h using a pragma statement.
>
> 1. Is there any suggested way to prevent this import
> without modifying python.h?

Assuming you're using Visual C++, you could use delay loading, which
essentially converts any imported DLL to use LoadLibrary/GetProcAddress
without requiring any code changes.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcconLinkerSupportForDelayedLoadingOfDLLs.asp

or

http://tinyurl.com/2bmzr

-Mike





More information about the Python-list mailing list