home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tk42r2s.zip
/
tk4.2
/
os2
/
tkOS2Dll.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-25
|
1KB
|
64 lines
/*
* tkOS2Dll.c --
*
* This file contains a stub dll entry point.
*
* Copyright (c) 1996-1998 Illya Vaes
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkPort.h"
#include "tkOS2Int.h"
int _CRT_init(void);
void _CRT_term(void);
/* Save the Tk DLL handle for TkPerl */
unsigned long dllHandle = (unsigned long) NULLHANDLE;
/*
*----------------------------------------------------------------------
*
* _DLL_InitTerm --
*
* DLL entry point.
*
* Results:
* TRUE on sucess, FALSE on failure.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
unsigned long _DLL_InitTerm(unsigned long modHandle, unsigned long flag)
{
/*
* If we are attaching to the DLL from a new process, tell Tk about
* the hInstance to use. If we are detaching then clean up any
* data structures related to this DLL.
*/
switch (flag) {
case 0: /* INIT */
/* Save handle */
dllHandle = modHandle;
TkOS2InitPM();
TkOS2XInit(TkOS2GetAppInstance());
return TRUE;
case 1: /* TERM */
TkOS2ExitPM();
/* Invalidate handle */
dllHandle = (unsigned long)NULLHANDLE;
return TRUE;
}
return FALSE;
}