home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.0 KB | 89 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWLibMai.cpp
- // Release Version: $ 1.0d11 $
- //
- // Creation Date: 3/25/94
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifdef FW_BUILD_WIN
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef __WINDOWS_H
- #include <Windows.h>
- #endif
-
- // prevent LibMain from being mangled
-
- extern "C"
- {
- #ifdef FW_BUILD_WIN16
- BOOL CALLBACK LibMain(HANDLE hInstance,
- WORD wDataSeg,
- WORD cbHeap,
- LPSTR lpszCmdLine);
- #endif
- #ifdef FW_BUILD_WIN32S
- BOOL WINAPI DllMain(HANDLE hDLL,
- DWORD dwReason,
- LPVOID lpReserved);
- void _cinit(); // static constructors
- void _dodtors(); // static destructors
- #endif
- };
-
- #ifdef FW_BUILD_WIN16
-
- HINSTANCE FW_SHARED_DATA gFWOSInstance = NULL;
-
- //----------------------------------------------------------------------------------------
- // GetDLLInstance
- //----------------------------------------------------------------------------------------
-
- HINSTANCE GetDLLInstance()
- {
- return gFWOSInstance;
- }
-
- //----------------------------------------------------------------------------------------
- // LibMain
- //----------------------------------------------------------------------------------------
- BOOL CALLBACK LibMain(HANDLE hInstance,
- WORD /* wDataSeg */,
- WORD /* cbHeap */,
- LPSTR /* lpszCmdLine */)
- {
- gFWOSInstance = hInstance;
- return hInstance != NULL;
- }
- #endif
-
- #ifdef FW_BUILD_WIN32S
-
- #pragma DOSSEG
- #pragma startaddress(DllMain)
-
- //----------------------------------------------------------------------------------------
- // DllMain
- //----------------------------------------------------------------------------------------
- BOOL WINAPI DllMain(HANDLE /* hDLL */,
- DWORD dwReason,
- LPVOID /* lpReserved */)
- {
- if(dwReason == DLL_PROCESS_ATTACH)
- _cinit();
- else if(dwReason == DLL_PROCESS_DETACH)
- _dodtors();
-
- return TRUE;
- }
- #endif
-
- #endif
-