From 0475be993559aaebe982bc79e0d6de7f30ecbffe Mon Sep 17 00:00:00 2001 From: vczh Date: Wed, 20 Oct 2021 15:56:30 -0700 Subject: [PATCH] Fix gGac issue: 12/11/10 --- .../GacUI_Controls/ProgressAndAsync/Main.cpp | 19 ++++++++++++++++++- .../GacUI_Controls/TextEditor/UI/Resource.xml | 2 +- .../TextEditor/UI/Source/DemoPartialClasses.h | 2 +- Tutorial/GacUI_Xml/Event_ViewModel/Main.cpp | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp b/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp index 4a7ad6f5..33e5aa74 100644 --- a/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp @@ -1,5 +1,10 @@ #define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" +#if defined VCZH_MSVC +#include +#elif defined VCZH_GCC +#include +#endif using namespace vl::collections; using namespace vl::stream; @@ -11,20 +16,32 @@ public: { GetApplication()->InvokeAsync([=]() { + // This is a fake progress, it is just for demo +#if defined VCZH_MSVC HttpRequest request; request.SetHost(L"http://www.microsoft.com/"); HttpResponse response; HttpQuery(request, response); - // This is a fake progress, it is just for demo progress(1); for (vint i = 2; i <= 10; i++) { Sleep(500); progress(i); } + callback(response.GetBodyUtf8()); +#elif defined VCZH_GCC + progress(1); + for (vint i = 2; i <= 10; i+=2) + { + Sleep(1000); + progress(i); + } + + callback(L"HttpQuery function only works on Windows."); +#endif }); } }; diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Resource.xml b/Tutorial/GacUI_Controls/TextEditor/UI/Resource.xml index 77636559..c1a2f7e0 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Resource.xml +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Resource.xml @@ -4,7 +4,7 @@ Source ..\..\UIRes\TextEditor.bin - ..\..\Utilities.h + ../../Utilities.h Demo diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h index 775c975f..3406ca71 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h @@ -10,7 +10,7 @@ https://github.com/vczh-libraries #ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES #define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES -#include "..\..\Utilities.h" +#include "../../Utilities.h" #if defined( _MSC_VER) #pragma warning(push) diff --git a/Tutorial/GacUI_Xml/Event_ViewModel/Main.cpp b/Tutorial/GacUI_Xml/Event_ViewModel/Main.cpp index 91b10d1f..1f88de38 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/Main.cpp +++ b/Tutorial/GacUI_Xml/Event_ViewModel/Main.cpp @@ -7,7 +7,7 @@ using namespace vl::stream; class ViewModelImpl : public Object, public virtual demo::IViewModel { public: - vint32_t Add(vint32_t a, vint32_t b)override + vint Add(vint a, vint b)override { return a + b; }