Using IHTMLDocument instead of IWebBrowser2 - c++

I want to display a simple web page in my Win32 application.
I have read this question
IWebBrowser2: how to force links to open in new window?
I want to do exactly stated in the reply of the question, but havn't found a code example.
Is there a simple example which shows how to use IHTMLDocument instead of IWebBrowser2 to render HTML documents inside a Win32 application.

IHTMLDocument is a non-visual component and so cannot do what you ask. IWebBrowser2 is the visual component that you need.

Related

Get HTML output in a window in c++ using Win32

I am new to C++. I really need to know how to get the output of HTML file in a window instead of getting that in browser. I searched so many sites. I got to know by using Tidy library, will get that but I don't know how to proceed with that.
Can any one please tell me how I will get the HTML output in a window?
I am using WIN32 API.
If I understand what you want, you would like to display HTML.
Internet Explorer as an ActiveX control should work for you, you can host HTML pages within your application. It is a deep subject, but you can get started by looking up information on the interface:
IWebBrowser2
If you are creating a windows application, open your dialog editor and add a reference to the MS Web Browser control, I can't tell you specifically what it is, but it should be in the list of COM controls available

How do I call C++ code when a button is clicked in a WPF application in C#?

I don't have any idea of how a connection between wpf and c++ code is made. I have added a record button in my wpf application. Is it possible to wrap the c++ solution here: http://msdn.microsoft.com/en-us/library/hh855374.aspx so that when the record button is pushed in the wpf, the c++ solution will get executed?
Yes, this is possible. You can use P/Invoke or a C++/CLI wrapper.
Or you could actually read that page your provided and find a link that says For more information about audio, see Capturing Audio Data in C#.

Hide scrollbars in WebBrowser control - MFC

I'm programming on MFC framework, VS 2008. And I follow this article Customize WebBrowser Control to hide scrollbars in WebBrowser control. The strange thing is that it works well with many websites for example www.vnexpress.net or www.dantri.com, but not with Microsoft page www.microsoft.com, i.e. the web browser always displays the vertical scrollbar on the right when navigating www.microsoft.com regardless what I am doing.
I've been googling for a day but did not find the answer. Does anyone knows how this could happen and how to solve this issue?
Thank you so much for your help!
I found the following from a contributor on CodeProject in the discussion section of Using the WebBrowser control,simplified:
You need to add the following code to the start of the OnDocumentComplete() event handler:
CComPtr pdispDoc;
_Browser->get_Document(&pdispDoc);
CComQIPtr piDoc(pdispDoc);
CComPtr piElem;
CComPtr piBody;
piDoc->get_body(&piElem);
if(piElem)
{
piElem->QueryInterface(&piBody);
piBody->put_scroll(CComBSTR(_T("no"))); //Hides scrollbars!
}

Writing a wrapper class for an ActiveX control

I am given a video calling software which implements an activex control to render the video in a web browser. As activex works only in IE i am given the task of implementing a cross-browser version of the activex control using FireBreath framework.
I need to write a wrapper class for the activeX control.
I am new to activex,visual studio(eveything involved in the project). And the activex code has thousands of lines of code. It is taking a long time for me to understand the code.
Does anyone have any good example wrapper classes and any other suggestions or links which would help my project?
The closest I know of is this: https://github.com/firebreath/FBAXExample
It's an example of hosting an activex control inside a FireBreath plugin. You'd be better off (and a lot cleaner) if you can do a complete port, but it may be possible to do it with just a wrapper; you may also want to look at the WebView library in FireBreath itself, which embeds IE inside a FireBreath plugin. You can find it here: https://github.com/firebreath/FireBreath/tree/master/src/libs/WebView/Win

Need a good unmanaged C++ OCX example

I need a very simple and clear example of how to create an OCX in unmanaged C++ code. Ideally, I'd like to consume it in Office, but any container (i.e. VB6, .NET WinForms) should be good.
I am having trouble seeing how I can add controls to the OCX canvas... I have seen examples of opening dialogs from within the OCX's load event... but that is not what I want... I need the GUI in the OCX itself.
Have you looked at this Microsoft tutorial. It uses MFC. If you want to create a windowless control you would need to use ATL.