[15.5] What about DLLs?

DLL (Dynamic Link Libraries) are the Windows equivalent of code resources -- chunks of executable code that other programs can run. All Windows XObjects are implemented as DLLs, as indeed is much of the Windows system itself.

XObject DLLs conform to a particular interface and support the usual mNew, mDispose and mDescribe methods, but there are all sorts of other DLLs too. These others cannot just be opened blithely for Director to use.

Just as DfM can talk to XCMDs and XFNCs via a special "glue" XObject, DfW gains access to DLLs at large, and also to Windows system calls implemented in modules such as USER.EXE, via a similar (if somewhat more arcane) XObject called DLLGLUE.DLL.

DLLGlue is mNewed to open a link to a single routine in some specified DLL. This routine can then be called directly from the Lingo code.

DLLGlue needs to be used with care. In particular, you need to know exactly how the routine you are invoking works before calling it -- DLLGlue has no way of checking the validity of the parameters you pass, and wrong parameters may cause untold grief. Always pay close attention to the documentation for the DLL or API calls you make.