No Description

TestApp1.cpp 786B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // TestApp1.cpp : Defines the entry point for the application.
  2. //
  3. #ifdef _WIN32
  4. #include "Win32/stdafx.h"
  5. #endif
  6. #include <DK.h>
  7. #include <functional>
  8. class TestApp1 : public DKApplication
  9. {
  10. public:
  11. };
  12. #ifdef _WIN32
  13. int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
  14. _In_opt_ HINSTANCE hPrevInstance,
  15. _In_ LPWSTR lpCmdLine,
  16. _In_ int nCmdShow)
  17. #else
  18. int main(int argc, const char * argv[])
  19. #endif
  20. {
  21. TestApp1 app;
  22. app.EventLoop()->Post(DKFunction([&]()
  23. {
  24. DKLog("test1");
  25. })->Invocation(), 2);
  26. app.EventLoop()->Post(DKFunction([&]()
  27. {
  28. DKLog("test2");
  29. })->Invocation(), 4);
  30. app.EventLoop()->Post(DKFunction([&]()
  31. {
  32. DKLog("Terminate!!");
  33. app.Terminate(0);
  34. })->Invocation(), 6);
  35. return app.Run();
  36. }