It is of my understanding that in order for mIRC to interface properly with a DLL through the scripting, that the dll has to have a few things. Firstly, it has to have functions that have certain parameters, and secondly, it needs the standard function startup stuff. I use C/c++, not DELPHI, so hopefully this is of some help.
Here is the function header for a procedure that mIRC calls in one of the DLLs I wrong:
int __stdcall GetSong(HWND mWnd, HWND aWnd, char *Data, char *Parms, BOOL Show, BOOL NoPause);
Here is the procedure header I use to start up the DLL, when DLLs are attached to a process in windows, this is always called:
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
I dunno if this is all that much help to you, but below is a link to the MSDN information on DllMain entry points in DLLs.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/dllmain.asp
I can't remember exactly how you keep DLLs loaded, I don't think I ever wrote one that needed that.
Anyways, it's been a long time since I've done any work with DLLs, and if you would like the sourcecode to that simple Winamp song grabber, send me a private message via this board with your email address, and I'll ship it out to ya ASAP.