OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
12namespace owl {
13
14// Common Controls diagnostic group
16
18
25
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);
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//
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//
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//
64void
66{
67 throw *this;
68}
69
70//
71/// Constructs a TXCommCtrl exception from scratch, and throws it.
72//
73void
75{
76 TXCommCtrl().Throw();
77}
78
79} // OWL namespace
80
#define CHECK(condition)
Definition checks.h:239
#define DIAG_DEFINE_GROUP_INIT(f, g, e, l)
Definition checks.h:429
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
Exception object thrown by the Common Control wrappers of ObjectWindows.
Definition commctrl.h:77
void Throw()
Method to localize the actual call to 'throw' an TXCommCtrl object.
Definition commctrl.cpp:65
TXCommCtrl()
Constructor of the Object thrown by the CommonControl wrappers of ObjectWindows.
Definition commctrl.cpp:41
static void Raise()
Constructs a TXCommCtrl exception from scratch, and throws it.
Definition commctrl.cpp:74
TXCommCtrl * Clone()
Route to copy an exception object.
Definition commctrl.cpp:53
TXOwl is root class of the ObjectWindows exception hierarchy.
Definition except.h:38
Definition of classes for CommonControl encapsulation.
#define _T(x)
Definition cygwin.h:51
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
Definition commctrl.cpp:19
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
Definition defs.h:299
auto GetCommCtrlVersion() -> DWORD
Returns the version number of the Common Control library (ComCtl32.dll).
Definition commctrl.cpp:26
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
#define OWL_INI
Definition defs.h:170