OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
libmain.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Default implementation of DLlEntryPoint()/LibMain() for user DLLs
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9#include <owl/applicat.h>
10
11#if defined(__BORLANDC__)
12# pragma option -w-ccc // Disable "Condition is always true/false"
13#endif
14
15namespace owl {
16
19
20} // OWL namespace
21
22using namespace owl;
23
24// MSC code in module.cpp
25#if !defined(_BUILDOWLDLL) && !defined(_OWLDLL)
26#if defined(BI_COMP_BORLANDC)
27// NOTE: We use priority 31 to come just before/after ctr/dtr of global
28// objects (which are assigned a priorority of 32)
29//
30long TlsAddRefs();
31long TlsRelease();
32
33static void __initOWL()
34{
35 TlsAddRefs();
36}
37#pragma startup __initOWL 31
38
39//
40static void __termOWL()
41{
42 TlsRelease();
43}
44#pragma exit __termOWL 31
45#endif // BI_COMP_BORLANDC
46#endif // if !_BUILDOWLDLL
47
48#if defined(BI_COMP_MSC)
50#else
52#endif
53{
54 TRACEX(OwlMain, 0, "DllEntryPoint(" << hInstance << ", " << reason << ", " <<
55 ") called");
56
57 switch (reason) {
59
60 // If you provide your own version of DLL EntryPoint, make sure
61 // you call OwlInitUserDLL to allow OWL to initialize '::Module'
62 //
63 return OWLInitUserDLL(hInstance, _T("")) ? 1 : 0;
64 }
65 return 1;
66}
67
Definition of class TApplication.
#define DIAG_DECLARE_GROUP(group)
Definition checks.h:404
#define TRACEX(group, level, message)
Definition checks.h:263
#define _T(x)
Definition cygwin.h:51
int WINAPI DllEntryPoint(HINSTANCE hInstance, uint32 reason, LPVOID)
Definition libmain.cpp:51
long TlsAddRefs()
Definition thread.cpp:761
long TlsRelease()
Definition thread.cpp:766
bool OWLInitUserDLL(HINSTANCE hInstance, LPCTSTR cmdLine)
Initialization routine that must be called from User DLL if DLL provides it's own entry point [i....
Definition initdll.cpp:31
STDAPI_(owl::TDocTemplate **) GetDocTemplateHead(owl STDAPI_(owl::TModule **) GetModulePtr(owl in OwlMain)(int argc, TCHAR *argv[])
Main entry point for an Owl application.
Definition module.h:391
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
unsigned long uint32
Definition number.h:34
OWL_DIAGINFO
Definition animctrl.cpp:14