home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
odbc_hlp.zip
/
odbctran.zip
/
LIBMAIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-01
|
2KB
|
64 lines
/*-----------------------------+
| LibMain |
+------------------------------+
| main routine for library |
+-----------------------------*/
/*----------------+
| Include files |
+----------------*/
#include "os2.h"
HAB NEAR BQEHINST = 0; // anchor block
HMODULE NEAR BQEHMOD = 0; // Library instance handle
extern "C" {
int _CRT_init(void); // Run time library init
void __ctordtorInit(void); // constructor destructor init
void _CRT_term(void); // Run time library term
void __ctordtorTerm(void); // constructor destructor term
}
extern "C" {
ULONG _DLL_InitTerm(ULONG hInstance, ULONG termFlag)
{
/*--------------------------------------------------------------+
| Purpose: This is the main routine for the TRANSLATION DLL |
| |
| Author: Joe Vas Date: June 1995 |
| |
| Copyright: 1987-1995 INTERSOLV, Inc. |
| |
| This software contains confidential and proprietary |
| information of INTERSOLV, Inc. |
+--------------------------------------------------------------*/
switch(termFlag) {
case 0:
//
// The C run-time environment initialization function must be
// called before any calls to C run-time functions that are not
// inlined.
//
if (_CRT_init() == -1)
return 0;
__ctordtorInit();
BQEHMOD = hInstance;
BQEHINST = WinQueryAnchorBlock(HWND_DESKTOP);
break;
case 1 :
__ctordtorTerm();
_CRT_term();
break;
}
return (1);
}
} // End of Extern C