开发者

Is OLE automation a good choice to automate IE via C++?

I am new to machine-oriented programming and..

I want to open a website in IE - download the whole content of that site - and save it to a specified temporary file. What is the best way to do this with pure开发者_StackOverflow中文版 C++? Any suggestions and / or examples? I stumbled over OLE automation. Would that be a good choice?

Sencerely, Konstanze


If you want 'pure' C++ then automation's your best shot.

You could also do this in C++/CLI.

http://msdn.microsoft.com/en-us/library/aa752044(v=vs.85).aspx

Scroll to the bottom for C++ samples.

Also, familiarize yourself with the basic concepts of COM before you move forward.


You are better off:

  1. opening a HTTP connection to the page you want to download;
  2. open a write handle to the temporary file;
  3. read the connection data into a temporary buffer;
  4. write the content of the buffer to the file handle from (2);
  5. repeat steps (3) and (4) in a loop until there is no more data;
  6. close the file and http connection handles.

You should be able to google for the APIs to use (IIRC, something like HttpOpen on windows).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜