| Summary | This article clarifies the use of ORB_init() inside a Dynamic Load Library (DLL). |
|---|---|
| Article Number | 36408 |
| Environment | Orbix 6.3 C Windows |
| Question/Problem Description | CORBA::ORB_init() hangs when called inside a DLL's DllMain() method. Where should ORB_init() be called in order to initialize an ORB? |
| Clarifying Information |
The DllMain() is an optional entry point into a dynamic-link library (DLL).
|
| Error Message | |
| Defect/Enhancement Number | |
| Cause | |
| Resolution | ORB_init() must not be called inside a DLL's DllMain() method, as this can cause serious issues and deadlocks due to the loader lock that DLLMain() is called under. An ORB should be initialized by calling ORB_init() from the main function of an application. |
| Workaround | |
| Notes | For further information, please see "Best Practices for Creating DLLs": http://msdn.microsoft.com/en-us/library/windows/hardware/gg487379.aspx and DLLMain docs at http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583(v=vs.85).aspx |
| Attachment |
| Created date: | 22 November 2012 |
|---|---|
| Last Modified: | 12 February 2013 |
| Last Published: | 22 November 2012 |
| First Published date: | 22 November 2012 |
#Orbix
#KnowledgeDocs