0
C++ Metro 스타일 앱을 사용하여 사이트에서 다운로드 XML 파일에 대한 http url을 연결하는 방법을 알고 싶습니다.C++ Metro 스타일 앱에서 URL 연결을 사용하는 방법
C++ Metro 스타일 앱을 사용하여 사이트에서 다운로드 XML 파일에 대한 http url을 연결하는 방법을 알고 싶습니다.C++ Metro 스타일 앱에서 URL 연결을 사용하는 방법
당신은 IXMLHTTPRequest2 사용할 수 있습니다
// First create the interface objects required for this operation
// as well as the callback that indicates request completion.
// The dwStatus variable is also defined, and is later set with a
// value indicating request completion.
DWORD dwStatus = 0;
ComPtr<IXMLHTTPRequest2> spXHR;
ComPtr<CXMLHttpRequest2Callback> spMyXhrCallback;
ComPtr<IXMLHTTPRequest2Callback> spXhrCallback;
// Create an object of the IID_IXMLHTTPRequest2 class.
CoCreateInstance(CLSID_FreeThreadedXMLHTTP60,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&spXHR));
// Create and initialize IXMLHTTPRequest2Callback
MakeAndInitialize<CXMLHttpRequest2Callback>(&spMyXhrCallback);
spMyXhrCallback.As(&spXhrCallback);
// Prepare the GET request and send it to the server.
spXHR->Open(L"GET", // Method.
pcwszUrl, // Url.
spXhrCallback.Get(), // Callback.
NULL, // Username.
NULL, // Password.
NULL, // Proxy username.
NULL); // Proxy password.
spXHR->Send(NULL, 0);
// Wait for the completion of the request.
spMyXhrCallback->WaitForComplete(&dwStatus);