bool ArrayValueWrapper::HasBaseIndicies()
		{
			BOOL result;
			CheckHResult(ArrayValue->HasBaseIndicies(&result));

			return (result == TRUE ? true : false);
		}
예제 #2
0
		bool StepperWrapper::IsActive()
		{
			BOOL active;
			CheckHResult(Stepper->IsActive(&active));

			return (active == TRUE ? true : false);
		}
		int ArrayValueWrapper::GetElementType()
		{
			CorElementType result;

			CheckHResult(arrayValue->GetElementType(&result));

			return result;
		}
		UInt32 ArrayValueWrapper::GetRank()
		{
			if (rank == -1)
			{
				ULONG32 tempRank;
				CheckHResult(ArrayValue->GetRank(&tempRank));

				rank = tempRank;
			}

			return rank;
		}
예제 #5
0
// 根据制定的类型创建下载任务,返回任务处理http响应数据
task<HRESULT> WRTHttpRequest::DownloadAsync(PCWSTR httpMethod, 
											PCWSTR uri, 
											cancellation_token cancellationToken,
											PCWSTR contentType, 
											IStream* postStream, 
											uint64 postStreamSizeToSend)
{
	// 创建IXMLHTTPRequest2对象
    ComPtr<IXMLHTTPRequest2> xhr;
    CheckHResult(CoCreateInstance(CLSID_XmlHttpRequest, nullptr, CLSCTX_INPROC, IID_PPV_ARGS(&xhr)));

    // 创建回调
    auto httpCallback = Make<HttpRequestCallback>(xhr.Get(),_response,cancellationToken);
    CheckHResult(httpCallback ? S_OK : E_OUTOFMEMORY);

    auto completionTask = create_task(httpCallback->GetCompletionEvent());

    // 创建请求
    CheckHResult(xhr->Open(httpMethod, uri, httpCallback.Get(), nullptr, nullptr, nullptr, nullptr));

    if (postStream != nullptr && contentType != nullptr)
    {
        CheckHResult(xhr->SetRequestHeader(L"Content-Type", contentType));
    }

    // 发送请求
    CheckHResult(xhr->Send(postStream, postStreamSizeToSend));

	// http请求完成时返回完成task,由于请求完成要调用回调方法,为了确保处理流程正确,特将回调方法作为参数传递进来
    return completionTask.then([this, httpCallback](HRESULT hr)
    {
		if(SUCCEEDED(hr))
			WRTHttpClient::getInstance()->response(_response);        	
        return hr;
    });
}
예제 #6
0
		void StepperWrapper::Step(bool stepInto)
		{
			CheckHResult(Stepper->SetInterceptMask(INTERCEPT_ALL));
			Stepper->SetUnmappedStopMask(STOP_ALL);
			CheckHResult(Stepper->Step((stepInto ? TRUE : FALSE)));
		}
예제 #7
0
		void StepperWrapper::Deactivate()
		{
			CheckHResult(Stepper->Deactivate());
		}
예제 #8
0
		void StepperWrapper::StepOut()
		{
			CheckHResult(Stepper->SetInterceptMask(INTERCEPT_ALL));
			Stepper->SetUnmappedStopMask(STOP_ALL);
			CheckHResult(Stepper->StepOut());
		}