the auto detect is easy however the only thing you could do is unload. this means your dll would have to detect the first instance (more code) then perform the same command to the first copy (more code) then unload (more code to only remain loaded if its the first copy). It couldnt remain loaded because mirc will still unload both copies when its closed. this would mean you would have to determine at unload time if this is the first copy(more code) before performing its cleanup (such as deleting stored memory etc..) so that the memory remains valid for all copies as the loaded dll's are unwound.

it can be done by adding alot of additional code or by mirc simply checking its loaded dll's. one of the largest complaints i see on various sites is about dll size. most scripters complain if the size is over 100k (wich is incredably small for a file sitting on a 30GB hdd btw). adding alot more code would mean less people will use them. kinda defeats the purpose of writing them ne?

i propose a switch for example /dll -c for copy. this has a major advantage. it requires the scripter to know they are loading a copy. this will avoid accidental loading of a copy.

i agree that scripters should use better code (i have my own /CallDll alias) but this includes not relying on unplanned behaviour.

i doubt it was done that way intentionally or it woulda been in the hlp.

i guess i didnt read your last post too well. No you wouldnt use the filename itself to determine if its been loaded. Most likely the fastest way would be to simply add a property to the mirc window. if that property exists then another copy is loaded and its value is its instance handle (HINSTANCE). Most likely ill add an CreateGlobalData function with the acompanying GetGlobalData function in my sdk. Problem is im the only one using my sdk so other dll's will still have problems (unless then write thier own handling).

Last edited by Narusegawa_Naru; 18/01/05 01:30 PM.

Have Fun smile