--- q_a/samples/resdll/readme.txt 2018/08/09 18:29:29 1.1.1.1 +++ q_a/samples/resdll/readme.txt 2018/08/09 18:29:52 1.1.1.2 @@ -5,105 +5,9 @@ Summary: The RESDLL sample shows how to create a resource-only dynamic link library (DLL). In short, this is accomplished by creating and resource-compiling a resource (.RC) file, -creating and compiling a source code (.C) file containing -a simple DLL entry point, and then linking the resulting -.RBJ and .OBJ files with the appropriate libraries to -create the DLL. +and then linking it correctly. The MAIN.EXE program tests THE_DLL.DLL by loading it and referencing the DLL's icon, cursor, and bitmap. The icon and cursor are used by the registered window class, and the bitmap is used in painting the client area. - -More information: - -In the preliminary release of Windows NT (July 1992) specifying -a DLL entry point for a resource-only DLL was not mandatory, -and the version of this sample included with the preliminary SDK -did not contain a DLL entry point. - -This has changed with the Beta release of Windows NT however, -and resource-only DLLs are required to have an entry point. -What follows is a very simple .C file and an updated MAKEFILE -which can be cut out and used with the existing files to -create valid .EXE & .DLL files: - - - snip! (THE_DLL.C) - o / - -----------------------x---------------------------------------------------- - o \ - - - /**************************************************************************\ - * - * MODULE: THE_DLL.C - * - * PURPOSE: To provide the required (simple) entry point for a resource- - * only DLL. - * - * FUNCTIONS: DLLEntryPoint() - DLL entry point - * - * Microsoft Developer Support - * Copyright (c) 1992 Microsoft Corporation - * - \**************************************************************************/ - - #include - - - - /**************************************************************************\ - * - * FUNCTION: DLLEntryPoint - * - * INPUTS: hDLL - handle of DLL - * dwReason - indicates why DLL called - * lpReserved - reserved - * - * RETURNS: TRUE (always, in this example.) - * - * Note that the retuRn value is used only when - * dwReason = DLL_PROCESS_ATTACH. - * - * Normally the function would return TRUE if DLL initial- - * ization succeeded, or FALSE it it failed. - * - \**************************************************************************/ - - BOOL WINAPI DLLEntryPoint (HANDLE hDLL, DWORD dwReason, LPVOID lpReserved) - { - return TRUE; - } - - - snip! (updated MAKEFILE) - o / - -----------------------x---------------------------------------------------- - o \ - - !include - - all: main.exe the_dll.dll - - main.obj: main.c - $(cc) $(cdebug) $(cflags) $(cvars) main.c - - the_dll.obj: the_dll.c - $(cc) $(cdebug) $(cflags) $(cvars) the_dll.c - - the_dll.rbj: the_dll.rc the_dll.bmp the_dll.cur the_dll.ico - rc -r -fo the_dll.res the_dll.rc - cvtres -$(CPU) the_dll.res -o the_dll.rbj - - the_dll.dll: the_dll.def the_dll.rbj the_dll.obj - $(link) $(linkdebug) \ - -base:0x1C000000 \ - -dll \ - -entry:DLLEntryPoint$(DLLENTRY) \ - -out:the_dll.dll \ - the_dll.rbj the_dll.obj $(guilibs) - - main.exe: main.obj main.def - $(cvtobj) $(cvtdebug) *.obj - $(link) $(linkdebug) $(guiflags) -out:main.exe main.obj $(guilibs)