I seem to be able to access the functions in C:\WINDOWS\system32\opengl32.dll
(and likewise C:\WINDOWS\system32\glu32.dll
) from either a 32-bit or a 64-bit application (for what it's worth, I'm doing this from separate 32-bit and 64-bit Python 2.7 interpreters, via the ctypes
module).
With glut32.dll
, things are different. It only happens to be on my Path
as part of a 32-bit installation of GraphViz. From 32-bit Python, I can link dynamically to it, but from 64-bit Python I get [Error 193] %1 is not a valid Win32 application
.
Now, this error does not surprise me, because I had always thought DLLs were obliged to commit to one architecture or another on Windows (in particular, this recent question and its answers seem to say so). What surprises me is the lack of an error in the first case... How does opengl32.dll
do it, and how can I replicate this behaviour when building my own DLLs?