1

How can I use IE control or some kind of webbrowser in c++ but without any external dependencies? I mean can be done with pure win api or something like that? I know the basics of c++ and the methods I know to use the webbrowser control needs the c++ libs to work.

Edit:
Sorry my question is unclear, im such a noob sometimes. What I mean is that I want that my compiled exe works on all windows without having to install any kind of libraries, but also I want that my compiled exe doesn't need to be shipped with any dlls, just the exe and it should get all the dependencies it needs to work from a base windows system (ie. a fresh winXP (or other version) install)

N 1.1
  • 12,418
  • 6
  • 43
  • 61
gtilx
  • 2,055
  • 4
  • 17
  • 21
  • 2
    You need to clarify external dependencies. Internet Explorer is by definition an external dependency, and you will need to pull in the right COM interfaces to be able to instantiate it. That being said, by placing all the definitions in your project you can create it using the Win32 API without linking to anything extra. – Simon Steele Oct 15 '10 at 15:42
  • 2
    This is sort of contradictory - if you use something then you depend on it. And sure you can write a browser with only Win API, but that's a huge project. – Nikolai Fetissov Oct 15 '10 at 15:44
  • Sorry my question is unclear, im such a noob sometimes. What I mean is that I want that my compiled exe works on all windows without having to install any kind of libraries, but also I want that my compiled exe doesn't need to be shipped with any dlls, just the exe and it should get all the dependencies it needs to work from a base windows system (ie. a fresh winXP (or other version) install). – gtilx Oct 15 '10 at 16:03
  • Good clarification to your question - *all* programs need external dependencies to run, if you count a computer to run it on as a dependency, or most likely an operating system to run it on too. – AshleysBrain Oct 15 '10 at 16:32

3 Answers3

2

Hosting Internet Explorer:

It is also possible to host WebKit or Gecko...

Writing your own from scratch using only GDI etc is probably not a good idea.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • To host WebKit or Gecko in Win I would need to distribute the app with some dll or library? – gtilx Oct 15 '10 at 16:20
  • gtilx: I'm sure you could link statically, but I think it is a lot less work just to use IE – Anders Oct 15 '10 at 22:45
0

Yes, it's easy. Just create a new dialog or something, then go to the Toolbox window, right-click and choose "Add Items...". From there, in the COM controls, find "Microsoft Web Browser" (I think it's called). After you've added that, you will be able to drag the web browser onto your dialog from the toolbox.

Mark Ingram
  • 71,849
  • 51
  • 176
  • 230
0

If you don't mind MFC, you can build a webbrowser into a single executable by compiling it as a static project. You will have to use the CHtmlView class as described here and here. The compiled exe will work on all windows and you will only need the single exe file, all necessary libraries will be compiled into that exe.

biscuits
  • 72
  • 3