ActiveX component to display in-memory MHTML in Windows

263 views Asked by At

I'm creating a small Windows application (C++) which create some windows an such (CreateWindowEx and the like). And in one window I want to add a control that shows MHTML loaded from memory, i.e. the whole MHTML content is in a string, not in a file.

I already tried the Shell.Explorer component, but I can't find a way to inject to it anything other than HTML (see AtlAxCreateControl).

Is it possible to use the Shell.Explorer component or any other to show in-memory MHTML??
That is, without writing the content to a file and then giving the file path. That works, but it's not optimal and it'll have to be the last alternative if I can't do it any other way.

PS: If this can be done in another language or environment like C#, JS, VBS, WSH, HTAs, I'm all ears as well.

1

There are 1 answers

0
FunkSoulBrother On

A bit late to answer, but still - there is a way to do it : use Microsoft's WebBrowser control (COM component, can be used in .Net apps as well).

Take a look an what the proposed solutions here - How to load mht from stream/string into a WebBrowser control? and here - How to display the string html contents into webbrowser control?. some of them refer to mhtml content but the solutions are applicable to ordinary html files as well.

Good luck.