the only drawback i see here is what happens when the user replaces the editor with a buggy one or if they remove it all togethor. one solution would be to keep the internal editor but have a command /useeditor <filename> to use whatever editor you choose. In this case if the editor doesnt exist or cant be loaded you still have the default one to fall back on.

to further add to this idea (by the way i like it alot) the new editor can use the same format as dll's do (and could be written in a dll as well). It would export a function similar to the LoadDll/UnloadDll functions. The only difference in this case is if the LoadEditor function doesnt exist then the old one is used instead. This way mirc can ensure that any initialization such as the current file to load is actually sent to the editor. I would suggest (a rough starting point)

typedef struct tagLOADEDITOR
{
const char *file_to_load;
unsigned long line_num;
//some other things an editor might need to init itself
}LOADEDITOR,*LPLOADEDITOR;

BOOL LoadEditor(LPLOADEDITOR editor)
{
return TRUE;//tells mirc that everythings fine do not open its internal editor
return FALSE;//something is wrong maybe we dont handle the file type run the default editor.
}

all of this is of course just a rough draft and can definately be added to but this way mirc can ensure that an editor of some kind will be opened wether its the internal one or an external one.

mirc should also export some functions such as

void Reload(const char *scriptname);
void Unload(const char *scriptname);

etc..

of course thsoe fn's could be made to return an error num instead in the event that scriptname doesnt exist or for whatever reason mirc could not perform the action.





Have Fun smile