2#include "acme/exception/exception.h"
3namespace APPLICATION_NAMESPACE
5CLASS_DECL_IMPORT
void application_factory(::factory::factory * pfactory);
9#include "acme/_operating_system.h"
10#include "acme/operating_system/process.h"
11#include APPLICATION_INCLUDE
23void acme_system_term();
25#include "acme/platform/system.h"
26#include "acme/platform/acme.h"
31#ifdef UNIVERSAL_WINDOWS
32#include "acme/operating_system/console.inl"
37#include "acme/platform/platform.h"
38#include "acme/platform/message_box.h"
39#include "acme/operating_system/acme_initialize.h"
65extern char_pointer *environ;
69::i32 wmain(::i32 argc,
wchar_t* argv[],
wchar_t* envp[])
71::i32
main(::i32 argc, char_pointer * argv)
82 auto psystem = ::hold(new ::PLATFORM_LAYER_NAME::system);
90 printf(
"argc=%d\n", argc);
91 for(::i32 i = 0; i < argc; i++)
93 auto pszParameter = argv[i];
94 if constexpr(std::is_same_v<
decltype(*argv[0]),
wchar_t>)
96 printf(
"argv[%d]=%S\n", i, (
wchar_t*) pszParameter);
100 printf(
"argv[%d]=%s\n", i, (char_pointer ) pszParameter);
105 psystem->initialize_system(argc, argv, envp);
107 psystem->m_bConsole =
true;
126 APPLICATION_NAMESPACE::application_factory(psystem->factory());
128 psystem->application_main();
131 catch (const ::exception& exception)
134 if (psystem->m_bConsole)
138 ::string strMessage(exception.get_message());
140 strMessage.find_replace(
"\n",
"\n ");
142 ::string strStack(exception.m_strCallStackTrace.c_str());
144 strStack.find_replace(
"\n",
"\n ");
151 " Error --------------------------- --- -- - - \n"
159 " Callstack --------- --- -- - - \n"
163 " ------------------------------------------------------------------------\n"
168 , strMessage.c_str(), strStack.c_str());
175 pmessagebox->initialize_message_box(exception,
"Exception",
"Exception", ::user::e_message_box_icon_error, exception.get_message() +
"\n\nCallstack:\n"+ exception.m_strCallStackTrace);
177 pmessagebox->display(e_display_normal, {});
179 pmessagebox->wait_dialog_response();
183 psystem->m_iExitCode = exception.m_estatus.exit_code();
189 if (psystem->m_bConsole)
192 fprintf(stderr,
"%s",
"Unhandled Exception");
199 pmessagebox->initialize_message_box(
"Unhandled Exception");
201 pmessagebox->display(e_display_normal, {});
203 pmessagebox->wait_dialog_response();
215 return psystem->m_iExitCode;
414#include "acme/memory/_new.inl"
420#include "_new_impl.h"
426#include "acme/_library.h"
441#define STATIC_FACTORY_INCLUDE "_static_factory_.inl"
442#include "acme/_static_factory.h"
Definition message_box.h:145
include "aura/graphics/image/context.h"
Definition aaaa__defer.h:32