SetProxy function throwing exception
-
Hi all, i am using this smart pointer to send http request to server:- IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL; Then through this I called the method setproxy where second parameter is having some ip address:- pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_DIRECT,varProxyName,L""); but this is causing exception and getlasterror() is returning "3".Please rovide some suggestions.
Thanks A Ton Ash_VCPP walking over water is just knowing where the stones are.....
-
Hi all, i am using this smart pointer to send http request to server:- IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL; Then through this I called the method setproxy where second parameter is having some ip address:- pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_DIRECT,varProxyName,L""); but this is causing exception and getlasterror() is returning "3".Please rovide some suggestions.
Thanks A Ton Ash_VCPP walking over water is just knowing where the stones are.....
When you call setProxy() have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface? Have you properly set up varProxyName?
1300 calories of pure beef goodness can't be wrong!
-
When you call setProxy() have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface? Have you properly set up varProxyName?
1300 calories of pure beef goodness can't be wrong!
Hi Bacon, First of all thanks for the reply....i have posted it three times but i get first reply so thanks. i have used pointer of the interface like this: IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL; and called the method setproxy on the same:- pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_PROXY,varProxyName); where varProxyName = SysAllocString(L"114.127.246.36:8080"); when you sya...."have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface" so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
Thanks A Ton Ash_VCPP walking over water is just knowing where the stones are.....
-
Hi Bacon, First of all thanks for the reply....i have posted it three times but i get first reply so thanks. i have used pointer of the interface like this: IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL; and called the method setproxy on the same:- pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_PROXY,varProxyName); where varProxyName = SysAllocString(L"114.127.246.36:8080"); when you sya...."have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface" so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
Thanks A Ton Ash_VCPP walking over water is just knowing where the stones are.....
Ash_VCPP wrote:
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
When you assign NULL to pIXMLHTTPRequest this tells it to point to nothing. You have to get an object of type IServerXMLHTTPRequest2 and assign it to pIXMLHTTPRequest before you can use it.
Ash_VCPP wrote:
so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
I haven't used IServerXMLHTTPRequest but it's a COM based object so you'll need to call CoCreateInstance() at some point. If you're not familiar with COM I suggest reading one of the introductions here on CP.
1300 calories of pure beef goodness can't be wrong!
-
Ash_VCPP wrote:
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
When you assign NULL to pIXMLHTTPRequest this tells it to point to nothing. You have to get an object of type IServerXMLHTTPRequest2 and assign it to pIXMLHTTPRequest before you can use it.
Ash_VCPP wrote:
so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
I haven't used IServerXMLHTTPRequest but it's a COM based object so you'll need to call CoCreateInstance() at some point. If you're not familiar with COM I suggest reading one of the introductions here on CP.
1300 calories of pure beef goodness can't be wrong!
hi Bacon, Please see the code: HRESULT hresult = CoInitialize(NULL); IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL; hr=pIXMLHTTPRequest.CreateInstance("Msxml2.ServerXMLHTTP.4.0"); that i have done.....please suggest if i am missing something.
Thanks A Ton Ash_VCPP walking over water is just knowing where the stones are.....