Initializing ArcObjects in a DLL

Discussion created by rlcave on Mar 3, 2011
Latest reply on Mar 4, 2011 by chump4life

I am working on a stand-alone program that reads data from various spatial data formats, one of which is ESRI geodatabases.  All of the code that accesses ESRI geodatabases resides in its own DLL.  When the client application needs to read a geodatabase, the DLL will perform the following steps:

1) call IAoInitialize::Initialize() to get a license
2) open the geodatabase workspace
3) read the data
4) close the workspace
5) call IAoInitialize::Shutdown(). 

Over the course of a user's session, Initialize() and Shutdown() are likely to be called several times each (in pairs).  Is this a reasonable approach, or would it be better to ensure that Initialize() and Shutdown() are called exactly one time each?  What are the possible consequences, if any, of calling Initialize() and Shutdown() more than once each.