Author Topic: Demo code for connecting to COM object WinHttp.WinHttpRequest.5.1  (Read 2777 times)

0 Members and 1 Guest are viewing this topic.

bugmagnet

  • Guest
I'd like to reimplement the following JScript in OxygenBASIC
Code: [Select]
var oHTTP = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
function URL( url ) {
var o = oHTTP.open("URL",url,false);
var s = oHTTP.send();
return oHTTP.ResponseText;
}
The SAPI examples aren't immediately obvious to me  :(

Where do I begin?

Kind regards,
bugmagnet

Charles Pegge

  • Guest
Re: Demo code for connecting to COM object WinHttp.WinHttpRequest.5.1
« Reply #1 on: April 18, 2013, 02:18:01 AM »
Hi Bruce, Welcome to our forum.

I'm not familiar with WinHttp, but I see it offers C/C++ APIs and COM APIs. I would opt for the C/C++ approach and try to get hold of some examples written in compilable Basic or C. Then it is a relatively simple matter to port them to OxygenBasic. This is where we can assist. It would be very useful to have some web stuff to include in the examples.

Charles

PS: MSDN overviews

http://msdn.microsoft.com/en-gb/library/windows/desktop/aa382925(v=vs.85).aspx

http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383158(v=vs.85).aspx
« Last Edit: April 18, 2013, 02:50:17 AM by Charles Pegge »

bugmagnet

  • Guest
Re: Demo code for connecting to COM object WinHttp.WinHttpRequest.5.1
« Reply #2 on: April 18, 2013, 06:41:53 AM »
Hi Bruce, Welcome to our forum.
Thank you. It's nice to be here.
Quote
I'm not familiar with WinHttp, but I see it offers C/C++ APIs and COM APIs. I would opt for the C/C++ approach and try to get hold of some examples written in compilable Basic or C. Then it is a relatively simple matter to port them to OxygenBasic. ...
Okay, I shall pursue that angle (which I hadn't thought of). In the interim, if I wanted to talk COM to Scripting.FileSystemObject or InternetExplorer.Application how would I approach it in Oxygen Basic?

Kind regards,
bugmagnet

Charles Pegge

  • Guest
Re: Demo code for connecting to COM object WinHttp.WinHttpRequest.5.1
« Reply #3 on: April 18, 2013, 10:45:26 AM »
It's outside my scope, unfortunately. I can only suggest trawling the web and windows SDK. Anything coded in C and/or low-level COM is do-able in Oxygen. Developing COM servers for web browsers can be problematic due to security restrictions, though.