// TestApp1.cpp : Defines the entry point for the application. // #ifdef _WIN32 #include "Win32/stdafx.h" #endif #include class TestApp1 : public DKApplication { DKObject thread; public: void OnInitialize(void) override { DKLog("---- SystemPath ----"); DKLog("SystemRoot: %ls", (const wchar_t*)DefaultPath(SystemPath::SystemRoot)); DKLog("AppRoot: %ls", (const wchar_t*)DefaultPath(SystemPath::AppRoot)); DKLog("AppResource: %ls", (const wchar_t*)DefaultPath(SystemPath::AppResource)); DKLog("AppExecutable: %ls", (const wchar_t*)DefaultPath(SystemPath::AppExecutable)); DKLog("AppData: %ls", (const wchar_t*)DefaultPath(SystemPath::AppData)); DKLog("UserHome: %ls", (const wchar_t*)DefaultPath(SystemPath::UserHome)); DKLog("UserDocuments: %ls", (const wchar_t*)DefaultPath(SystemPath::UserDocuments)); DKLog("UserPreferences: %ls", (const wchar_t*)DefaultPath(SystemPath::UserPreferences)); DKLog("UserCache: %ls", (const wchar_t*)DefaultPath(SystemPath::UserCache)); DKLog("UserTemp: %ls", (const wchar_t*)DefaultPath(SystemPath::UserTemp)); DKLog("---- ProcessInfo ----"); DKLog("HostName: %ls", (const wchar_t*)ProcessInfoString(ProcessInfo::HostName)); DKLog("OsName: %ls", (const wchar_t*)ProcessInfoString(ProcessInfo::OsName)); DKLog("UserName: %ls", (const wchar_t*)ProcessInfoString(ProcessInfo::UserName)); DKLog("ModulePath: %ls", (const wchar_t*)ProcessInfoString(ProcessInfo::ModulePath)); thread = DKThread::Create(DKFunction([this]() { this->EventLoop()->Post(DKFunction([&]() { DKLog("test1"); })->Invocation(), 2); this->EventLoop()->Post(DKFunction([&]() { DKLog("test2"); })->Invocation(), 4); this->EventLoop()->Post(DKFunction([&]() { DKLog("Terminate!!"); DKApplication::Instance()->Terminate(0); })->Invocation(), 6); })->Invocation()); } void OnTerminate(void) override { thread->WaitTerminate(); } }; #ifdef _WIN32 int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) #else int main(int argc, const char * argv[]) #endif { TestApp1 app; return app.Run(); }