I've noticed that on PSPad startup, the scripts are loaded and run 10 times
each! Is this planned behavior?

I'm writing some extensions that are loaded (ActiveXObject) by scripts, and if I
put the load statement in the Init() function, the object reference is released
at once [so I can't use this method], and if it's in the main body of the
script, the object is created and destroyed 10 times, which slows things down
considerably.

I realise that you probably didn't intend for scripts to do this sort of thing,
but it can be very handy.

And as a side note (sorry, a bit techy), if you're looking at redoing the
scripts loading bit, it would be much faster to call CoGetClassObject() once for
each scripting language, requesting the IClassFactory interface and then using
the CreateInstance method to create the individual script objects, than calling
CoCreateInstance() for each one like you're doing at the moment. If you have 15
.js files to load then you're creating and destroying 15 class factories, when
you only need to manage one. This would drastically improve load time.

-- 
<http://forum.pspad.com/read.php?2,40832,40832>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem