Check the Best Practices for Creating DLLs document:
You should never perform the following tasks from within DllMain:
- Call LoadLibrary or LoadLibraryEx (either directly or indirectly). This can cause a deadlock or a crash.
- Synchronize with other threads. This can cause a deadlock.
More Related Contents:
- Use Visual Studio 2012 and compile with older platform toolset?
- Exporting classes containing `std::` objects (vector, map etc.) from a DLL
- How to include OpenSSL in Visual Studio
- How do I build an import library (.lib) AND a DLL in Visual C++?
- How do I use a third-party DLL file in Visual Studio C++?
- How to set Visual Studio Filters for nested sub directory using cmake
- In Visual Studio, `thread_local` variables’ destructor not called when used with std::async, is this a bug?
- Loading a dll from a dll?
- Why can’t Visual Studio find my DLL? [duplicate]
- “Step over” when debugging multithreaded programs in Visual Studio
- C++ Reading an unknown number of integers to cin and outputting the sum
- Example for boost shared_mutex (multiple reads/one write)?
- Where does Visual Studio look for C++ header files?
- Displaying the #include hierarchy for a C++ file in Visual Studio
- How to include libraries in Visual Studio 2012?
- Export all symbols when creating a DLL
- Why is the destructor of a future returned from `std::async` blocking?
- How do I programmatically get the version of a DLL or EXE file?
- How to use SQLite in a multi-threaded application?
- what does __declspec(dllimport) really mean?
- .def files C/C++ DLLs
- Is there a way to automatically avoiding stepping into certain functions in Visual Studio?
- Is it smart to replace boost::thread and boost::mutex with c++11 equivalents?
- How to declare a global variable in C++
- C++11 STL containers and thread safety
- Do I need to protect read access to an STL container in a multithreading environment?
- How are user-level threads scheduled/created, and how are kernel level threads created?
- How to implement a unmanaged thread-safe collection when I get this error: is not supported when compiling with /clr
- Portable Compare And Swap (atomic operations) C/C++ library?
- VS: unexpected optimization behavior with _BitScanReverse64 intrinsic