![]() ![]() ![]() If you wish to use the second method and call the CRT initialization code yourself, instead of using DllMainCRTStartup() and DllMain(), there are two techniques: Note that DllMainCRTStartup() calls CRT_INIT() and CRT_INIT() will call your application's DllMain(), if it exists. Also refer to the Win32 Programmer's Reference for DllEntryPoint() and the Visual C++ documentation for DllMain(). The Win32 SDK samples all use the first method. This permits the C Run-time libraries to properly allocate and initialize C Run-time data when a process or thread is attaching to the DLL, to properly clean up C Run-time data when a process is detaching from the DLL, and for global C++ objects in the DLL to be properly constructed and destructed. The initialization function must be named DllMain() and the entry point must be specified with the linker option DLL's entry point must explicitly call CRT_INIT() on process attach and process detach. When building a DLL that uses any of the C Run-time libraries, in order to ensure that the CRT is properly initialized, either Section 2: Using the CRT libraries when building a DLL MSVCRT20.DLL comes in two versions: one for Windows NT and the other for Win32s. Note however, that MSVCRT10.DLL is not supported on Win32s, while CRTDLL.LIB is supported on Win32s. ![]() ![]() Its name depends on the version of VC++ (that is, MSVCRT10.DLL or MSVCRT20.DLL). Microsoft Visual C++ 32-bit edition contains these three forms as well, however, the CRT in a DLL is named MSVCRT.LIB. LIBCMT.LIB is a statically linked library that supports multithreaded programs.ĬRTDLL.LIB is an import library for CRTDLL.DLL that also supports multithreaded programs. LIBC.LIB is a statically linked library for single-threaded programs. There are three forms of the C Run-time library provided with the Win32 SDK: Original product version: Visual C++ Original KB number: 94248 Section 1: Three Forms of C Run-Time (CRT) Libraries Are Available This article describes how to use the C Run-time. ![]()
0 Comments
Leave a Reply. |