views:

121

answers:

3

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)

A: 

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
Thanks I think the COM control is what I was looking for. Will do some tests later.
gtilx
+1  A: 

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
To host WebKit or Gecko in Win I would need to distribute the app with some dll or library?
gtilx
gtilx: I'm sure you could link statically, but I think it is a lot less work just to use IE
Anders
A: 

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.

ikezue