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
15
namespace
owl
{
16
17
OWL_DIAGINFO
;
18
DIAG_DECLARE_GROUP
(
OwlMain
);
19
20
}
// OWL namespace
21
22
using 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
//
30
long
TlsAddRefs
();
31
long
TlsRelease
();
32
33
static
void
__initOWL
()
34
{
35
TlsAddRefs
();
36
}
37
#pragma startup __initOWL 31
38
39
//
40
static
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)
49
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstance
,
DWORD
reason
,
LPVOID
)
50
#else
51
int
WINAPI
DllEntryPoint
(
HINSTANCE
hInstance
,
uint32
reason
,
LPVOID
)
52
#endif
53
{
54
TRACEX
(
OwlMain
, 0,
"DllEntryPoint("
<<
hInstance
<<
", "
<<
reason
<<
", "
<<
55
") called"
);
56
57
switch
(
reason
) {
58
case
DLL_PROCESS_ATTACH
:
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
applicat.h
Definition of class TApplication.
DIAG_DECLARE_GROUP
#define DIAG_DECLARE_GROUP(group)
Definition
checks.h:404
TRACEX
#define TRACEX(group, level, message)
Definition
checks.h:263
VarType
Definition
safearray.h:14
_T
#define _T(x)
Definition
cygwin.h:51
pch.h
DllEntryPoint
int WINAPI DllEntryPoint(HINSTANCE hInstance, uint32 reason, LPVOID)
Definition
libmain.cpp:51
TlsAddRefs
long TlsAddRefs()
Definition
thread.cpp:761
TlsRelease
long TlsRelease()
Definition
thread.cpp:766
OWLInitUserDLL
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
OwlMain
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
owl
Object Windows Library (OWLNext Core)
Definition
animctrl.h:22
owl::uint32
unsigned long uint32
Definition
number.h:34
owl::OWL_DIAGINFO
OWL_DIAGINFO
Definition
animctrl.cpp:14
source
owlcore
libmain.cpp
Generated by
1.10.0