OWLNext    7.0
Borland's Object Windows Library for the modern age
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
17namespace owl {
18
21
22} // OWL namespace
23
24using namespace owl;
25
26//
27// Default WinMain calls OwlMain, after setting params into TApplication
28//
29int
31{
32 TRACEX(OwlMain, 0, _T("main() called"));
33
34 Gdiplus::GdiplusStartupInput gdiplusStartupInput;
36 Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
37
40
43 int retVal;
44 try {
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}
Definition of class TApplication.
#define DIAG_DECLARE_GROUP(group)
Definition checks.h:404
#define TRACEX(group, level, message)
Definition checks.h:263
static void SetWinMainParams(HINSTANCE hInstance, HINSTANCE hPrevInstance, const tstring &cmdLine, int cmdShow)
Set the data members with data from WinMain.
Definition applicat.h:694
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
Definition exbase.h:41
TXEndSession is thrown from TWindow's handler for WM_ENDSESSION.
Definition except.h:111
#define _tmain
Definition cygwin.h:93
#define _T(x)
Definition cygwin.h:51
Utilities for GDI+ interoperability.
TLocaleString - localized name support.
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
OWL_DIAGINFO
Definition animctrl.cpp:14
int HandleGlobalException(owl::TXBase &x, LPCTSTR caption, LPCTSTR canResume=nullptr)
Definition except.cpp:29
void InitGlobalModule(HINSTANCE hInstance)
Definition global.cpp:36