Module State Issues
The Objective Grid libraries require initialization before they can be used. During this process, resources are allocated and made available to the module that uses them. It is important that any such resources be available only to the module and not to the application. If such resources were to live in the application then several conflicts could arise.
Consider a case where two ATL-based DLLs link in Objective Grid. Assume that the first performs control registration. The second is then loaded. Both work fine. Then let us assume that the first control gets terminated, while the rest of the application continues to run. Like any good control, the first control cleans up after itself, un-registering the class. When the second control tries to create a control of this class, it fails.
Objective Grid is completely aware of these issues and can be used freely inside different ATL modules. Remember to call AFX_MANAGE_STATE(AfxGetStaticModuleState()) when you export functions that will be called from other modules. Non-module state aware MFC controls will fail under these situations. For more details on these issues, please see “Objective Grid DLL Architecture.”
In summary, we have provided guidelines and working code, as well as code generation helpers, for better ATL compatibility with Objective Grid. Please contact us if there are issues with this support, or if there are other features that you would like to see implemented.