Image

Imageeyeh8u wrote in Imagecpp

Hosting the IWebBrowser2 non-visually

Hi,

I have no C++ skills.

I need to create an instance of the IWebBrowser2 object in memory in a Windows Service to use the IOleCommandTarget::exec with OLECMDID_PRINT to print HTML documents to a specified server with no user intervention. This is proving to be a real thorny one as MS documentation says one thing, and then isn't updated when they remove that feature and so on.

I have now solved all problems except one, the IWebBrowser2 is an activex document and needs to be properly hosted in order to work, however, this is a print service, not an end user gui, so I don't want IE windows to be rendered accross the screen.

As I first stated, I have no C++ skills, so I have no idea how to go about this. I've solved all the other problems, such as loading the page, printing it with no print dialog, fiddling the system default printer so it comes out where I want and so on. But creating a non-gui-hosted IWebBrowser2 is just not getting anywhere.

Would any kind friendly guru care to help out with a little sample code? Or a url or 6?

Cheers