>> When you load a dll, the linker automatically runs DLLMain? How do you >get >> a routine in there before it? > >yes, the linker yes of course, but even if you make a LoadLibrary . If you >don't want to call the DLLMain , then you have to call an other function to >specify that you just want to load the DLL in memory like a regular file . tim - this is just like _init() and _fini() in a dlopen/dlclose situation. i don't know if windows allows the plugin to have no DLLMain function, though. *nix systems don't care if you don't define _init() and _fini(), and indeed, the vast majority of people do not. they are just there as hooks in case you need them. one example is to set up globals that code in the DLL will later use. C++ uses them too to handle static + global constructors/destructors. btw, this might be an interesting parallel to the approach MS took with attachments ... loading a DLL automatically causes code execution. could they really be that silly? ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: //www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe