well it could stay loaded provided it doesnt try to remove any data allocated by the first copy but in that case theres really no need to keep it loaded.

The easiest solution would be to simply return an error ReturnError(ERROR_INVALID_INSTANCE); or something similar. This would mean that the call would simply just fail. That would require the least amount of code to handle however ive noticed that more often then not scripters avoid using $dll like it was a plague. So then youd get a boatload of msg's complaining that 'ABC function does not work' lol.

As i mentioned in my previous post i added global support to my sdk for multiple instances

int __stdcall Function(args)
{
gGlobalData *pData = GetGlobalData("nickLUST");
if (pData.GetCreatorInstance() != hSelf) return RelayFunction(pData,same args as fn);
void *pInternal = pData.GetStorage();
//use pInternal here.
}

It works well except you have to add the code to each function you use (the ones exported to mirc). The size difference wasnt too much it only added about 3.5k. that was the actual sdk code and about 20 functions that needed it.

Ill try to come up with a way to stub the functions so i can simply use one call for all functions exported but not until my next project smile


Have Fun smile