OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
main.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
/// Implementation of WinMain for user exes
7
//----------------------------------------------------------------------------
8
#include <
owl/pch.h
>
9
#include <
owl/applicat.h
>
10
#include <
owl/lclstrng.h
>
11
#include <
owl/gdiplus.h
>
12
13
#if defined(__BORLANDC__)
14
# pragma option -w-ccc
// Disable "Condition is always true/false"
15
#endif
16
17
namespace
owl
{
18
19
OWL_DIAGINFO
;
20
DIAG_DECLARE_GROUP
(
OwlMain
);
21
22
}
// OWL namespace
23
24
using namespace
owl
;
25
26
//
27
// Default WinMain calls OwlMain, after setting params into TApplication
28
//
29
int
30
_tmain
(
int
argc,
tchar
* argv[])
31
{
32
TRACEX
(
OwlMain
, 0,
_T
(
"main() called"
));
33
34
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
35
ULONG_PTR gdiplusToken;
36
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
37
38
HINSTANCE hInstance = ::GetModuleHandle(NULL);
39
InitGlobalModule
(hInstance);
40
41
LPCTSTR cmdLine = GetCommandLine();
42
owl::TApplication::SetWinMainParams
(hInstance, 0, cmdLine ? cmdLine :
_T
(
""
), SW_SHOWNORMAL);
43
int
retVal;
44
try
{
45
retVal =
OwlMain
(argc, argv);
46
TRACEX
(
OwlMain
, 0,
_T
(
"WinMain() returns "
) << retVal);
47
}
48
catch
(
owl::TXEndSession
&) {
return
retVal = 0;}
49
catch
(
owl::TXBase
& x) {
return
retVal =
owl::HandleGlobalException
(x, 0);}
50
51
Gdiplus::GdiplusShutdown(gdiplusToken);
52
return
retVal;
53
}
applicat.h
Definition of class TApplication.
TRACEX
#define TRACEX(group, level, message)
Definition
checks.h:263
owl::TApplication::SetWinMainParams
static void SetWinMainParams(HINSTANCE hInstance, HINSTANCE hPrevInstance, const tstring &cmdLine, int cmdShow)
Set the data members with data from WinMain.
Definition
applicat.h:694
owl::TXBase
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
Definition
exbase.h:41
owl::TXEndSession
TXEndSession is thrown from TWindow's handler for WM_ENDSESSION.
Definition
except.h:111
_tmain
#define _tmain
Definition
cygwin.h:93
_T
#define _T(x)
Definition
cygwin.h:51
gdiplus.h
Utilities for GDI+ interoperability.
pch.h
lclstrng.h
TLocaleString - localized name support.
OwlMain
STDAPI_(owl::TDocTemplate **) GetDocTemplateHead(owl STDAPI_(owl::TModule **) GetModulePtr(owl int OwlMain(int argc, TCHAR *argv[])
Main entry point for an Owl application.
Definition
module.h:394
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::tchar
char tchar
Definition
defs.h:77
owl::OWL_DIAGINFO
OWL_DIAGINFO
Definition
animctrl.cpp:14
owl::HandleGlobalException
int HandleGlobalException(owl::TXBase &x, LPCTSTR caption, LPCTSTR canResume=nullptr)
Definition
except.cpp:29
owl::InitGlobalModule
void InitGlobalModule(HINSTANCE hInstance)
Definition
global.cpp:36
owl::DIAG_DECLARE_GROUP
DIAG_DECLARE_GROUP(OwlThread)
source
owlcore
main.cpp
Generated by
1.18.0