Alternatives to Invoking to Run a Method in an Add-in

In scenarios where a method or macro within an add-in needs to be run several times in a short time span, for example 60 times a second, invoking the method may not be the best option.  The invoke call, as seen in the ShapeAppMacroRecordingCSharp sample, is too slow to for the level of performance required in these high stress scenarios.  A good alternative to this is firing an event in the host and catching it in the add-in.  Particularly in NoRuntime style integrations this approach achieves higher performance.  Another workaround is to call into the add-in once and pass the number of times to run the method as a parameter.  While this will take some coding overhead in the add-in it does achieve very high performance and is ideal for high stress scenarios where the number of times a method needs to be run is known.  Don’t limit the performance of your host by sticking to the SDK samples.

 


Posted May 14 2010, 10:49 AM by Melody
Copyright Summit Software Company, 2008. All rights reserved.