Fix gGac issue: 12/11/10

This commit is contained in:
vczh
2021-10-20 15:56:30 -07:00
parent 0e3446a22f
commit 0475be9935
4 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,10 @@
#define GAC_HEADER_USE_NAMESPACE
#include "UI/Source/Demo.h"
#if defined VCZH_MSVC
#include <Windows.h>
#elif defined VCZH_GCC
#include <unistd.h>
#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
});
}
};