summaryrefslogtreecommitdiffstats
path: root/win/tkWin32Dll.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-12-08 00:46:51 (GMT)
committerhobbs <hobbs>2002-12-08 00:46:51 (GMT)
commit9ba6b47ef626dc8248e5fcd5a420d332baeaae53 (patch)
tree0980b63dd1bf1aabca841a318efcd6eaf6102981 /win/tkWin32Dll.c
parentdf50e6eb7fcee1b7b60c7dc9c0d1968124197b9e (diff)
downloadtk-9ba6b47ef626dc8248e5fcd5a420d332baeaae53.zip
tk-9ba6b47ef626dc8248e5fcd5a420d332baeaae53.tar.gz
tk-9ba6b47ef626dc8248e5fcd5a420d332baeaae53.tar.bz2
* generic/tkInt.decls: add TkWinSetHINSTANCE decl
* generic/tkIntPlatDecls.h: regen * generic/tkStubInit.c: regen * win/tkWinInit.c (TkpInit): While init and cleanup aren't correct * win/tkWinX.c (TkWinXInit): in DllMain, we had to specify the * win/tkWin32Dll.c (DllMain): true HINSTANCE or the resources of a dynamic Tk weren't being loaded correctly. Created a new function TkWinSetHINSTANCE for this purpose.
Diffstat (limited to 'win/tkWin32Dll.c')
-rw-r--r--win/tkWin32Dll.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c
index c8e03c1..4570a5a 100644
--- a/win/tkWin32Dll.c
+++ b/win/tkWin32Dll.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWin32Dll.c,v 1.5 2002/12/06 23:29:37 hobbs Exp $
+ * RCS: @(#) $Id: tkWin32Dll.c,v 1.6 2002/12/08 00:46:51 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -52,10 +52,10 @@ DllEntryPoint(hInst, reason, reserved)
*
* DllMain --
*
- * DLL entry point. It is not necessary to do anything here as
- * Tk will initialize and clean up after itself through other
- * methods, in order to be consistent whether the build is static
- * or dynamic.
+ * DLL entry point. It is only necessary to specify our dll here so
+ * that resources are found correctly. Otherwise Tk will initialize
+ * and clean up after itself through other methods, in order to be
+ * consistent whether the build is static or dynamic.
*
* Results:
* Always TRUE.
@@ -72,5 +72,13 @@ DllMain(hInstance, reason, reserved)
DWORD reason;
LPVOID reserved;
{
+ /*
+ * If we are attaching to the DLL from a new process, tell Tk about
+ * the hInstance to use.
+ */
+
+ if (reason == DLL_PROCESS_ATTACH) {
+ TkWinSetHINSTANCE(hInstance);
+ }
return (TRUE);
}