msxml.dd --XMLHttpRequest

webmasterbeta

New Member
#include <iostream.h>#include <TCHAR.H>#import "msxml.dll"using namespace MSXML;int main(){CoInitialize(NULL);HRESULT hr;IXMLHttpRequest *pIXMLHttpRequest = NULL;//try// {// create XMLHttpRequest object and initialize pIXMLHttpRequesthr = pIXMLHttpRequest->open(_bstr_t(_T("PUT")), _bstr_t(_T("http://star/Tutor/catalog.xml")),_variant_t(VARIANT_FALSE), _variant_t(""), _variant_t(""));if(SUCCEEDED(hr))::MessageBox(NULL, _T("Success !"), _T(""), MB_OK);// }// catch(...){// cout << "error occured\n";// DisplayErrorToUser();// }// Release pIXMLHttpRequest when done with it.return 0;}I just starting to program msxml in Visual C++. The above is my first attemptto initialize the IXMLHttpRequest object but the linehr = pIXMLHttpRequest->open(_bstr_t(_T("PUT")), _bstr_t(_T("http://premier-adam/Tutor/catalog.xml")),_variant_t(VARIANT_FALSE), _variant_t(""), _variant_t(""));Is reporting memory access violation.I found the msdn documentation in the regard unhelpful.Where can I get information about msxml API in Visual C++and what I am doing wrong in the above code.star -- is the name of my local machine.Than you all
 
Back
Top