OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
commctrl.cpp
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Implementation of TCommCtrlDll, a wrapper for the common control dll
7
//----------------------------------------------------------------------------
8
#include <
owl/pch.h
>
9
#include <
owl/defs.h
>
10
#include <
owl/commctrl.h
>
11
12
namespace
owl
{
13
14
// Common Controls diagnostic group
15
OWL_DIAGINFO
;
16
17
DIAG_DEFINE_GROUP_INIT
(
OWL_INI
, OwlCommCtrl, 1, 0);
18
19
void
InitializeCommonControls
(
uint
controlFlags)
20
{
21
const
auto
a = INITCOMMONCONTROLSEX{
sizeof
(INITCOMMONCONTROLSEX), controlFlags};
22
if
(!InitCommonControlsEx(&a))
23
throw
TXCommCtrl
{};
24
}
25
26
auto
GetCommCtrlVersion
() -> DWORD
27
{
28
TModule
m{
_T
(
"comctl32.dll"
),
true
,
true
,
false
};
// shouldLoad, mustLoad, addToList
29
auto
getVersion = TModuleProc1<HRESULT, DLLVERSIONINFO*>{m,
"DllGetVersion"
};
30
auto
i = DLLVERSIONINFO{
sizeof
(DLLVERSIONINFO)};
31
const
auto
r = getVersion(&i);
32
CHECK
(SUCCEEDED(r));
InUse
(r);
33
return
MAKELONG(i.dwMinorVersion, i.dwMajorVersion);
34
}
35
36
//----------------------------------------------------------------------------
37
38
//
39
/// Constructor of the Object thrown by the CommonControl wrappers of ObjectWindows.
40
//
41
TXCommCtrl::TXCommCtrl
()
42
:
43
TXOwl
(IDS_COMMCTRL)
44
{
45
}
46
47
//
48
/// Route to copy an exception object. The 'Clone' method is invoked when
49
/// an exception must be suspended. The cloned copy can latter be used to
50
/// resume the exception.
51
//
52
TXCommCtrl
*
53
TXCommCtrl::Clone
()
54
{
55
return
new
TXCommCtrl
(*
this
);
56
}
57
58
59
//
60
/// Method to localize the actual call to 'throw' an TXCommCtrl object.
61
/// \note Localizing the call to 'throw' is a size optimization: the
62
/// overhead of a 'throw' statement is generated only once.
63
//
64
void
65
TXCommCtrl::Throw
()
66
{
67
throw
*
this
;
68
}
69
70
//
71
/// Constructs a TXCommCtrl exception from scratch, and throws it.
72
//
73
void
74
TXCommCtrl::Raise
()
75
{
76
TXCommCtrl
().Throw();
77
}
78
79
}
// OWL namespace
80
CHECK
#define CHECK(condition)
Definition
checks.h:239
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TXCommCtrl
Exception object thrown by the Common Control wrappers of ObjectWindows.
Definition
commctrl.h:77
owl::TXCommCtrl::Throw
void Throw()
Method to localize the actual call to 'throw' an TXCommCtrl object.
Definition
commctrl.cpp:65
owl::TXCommCtrl::TXCommCtrl
TXCommCtrl()
Constructor of the Object thrown by the CommonControl wrappers of ObjectWindows.
Definition
commctrl.cpp:41
owl::TXCommCtrl::Raise
static void Raise()
Constructs a TXCommCtrl exception from scratch, and throws it.
Definition
commctrl.cpp:74
owl::TXCommCtrl::Clone
TXCommCtrl * Clone()
Route to copy an exception object.
Definition
commctrl.cpp:53
commctrl.h
Definition of classes for CommonControl encapsulation.
_T
#define _T(x)
Definition
cygwin.h:51
owl::TXOwl::TXOwl
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
Definition
except.cpp:123
pch.h
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::InitializeCommonControls
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
Definition
commctrl.cpp:19
owl::InUse
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
Definition
defs.h:299
owl::GetCommCtrlVersion
auto GetCommCtrlVersion() -> DWORD
Returns the version number of the Common Control library (ComCtl32.dll).
Definition
commctrl.cpp:26
owl::OWL_DIAGINFO
OWL_DIAGINFO
Definition
animctrl.cpp:14
owl::uint
unsigned int uint
Definition
number.h:25
owl::DIAG_DEFINE_GROUP_INIT
DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlApp, 1, 0)
defs.h
General definitions used by all ObjectWindows programs.
OWL_INI
#define OWL_INI
Definition
defs.h:170
source
owlcore
commctrl.cpp
Generated by
1.18.0