Multiple Concurrent DLLs
Posted on 2004-09-11
I have a DLL which is called from an Office productivity app. However, the initialisation data (provided by the caller) is unique to that instance. This initial data is subsequently used for correct functioning of the DLL .... At present it all works fine when I have just a single instance of the app & DLL active, but I want to progress to multiple documents ...
My question is, how do I handle multiple instances ? I can have multiple instances of the app, and/or multiple document instances. Can I tell the DLL to create a new instance each time (its not that big, so memory is not an issue), or should I create a new data structure for each instance with the unique data stored therein, or is there some other way ?
I would imagine this is a fairly common thing with MDI applications these days, but would like a 'heads up' before I start so I can go directly for the best solution.
Does anyone have any code snippets on this (preferably Delphi, but could convert VB or C code is necessary) ? All help, references etc appreciated.