Re: SHDocVw.InternetExplorer
You don't want to use SHDocVw.InternetExplorer, you want to use the COM based browser control.
However I would first ask what exactly was your issue with the managed browser and JSP?
Re: SHDocVw.InternetExplorer
When using the business JSP site (which is mandatory and unmodifiable) within the WebBrowser control, there is a button on the site which takes the user back to the results of their filter search in the Main Frame. In IE, this works perfectly, but in WebBrowser, it produced a blank white page in the main frame. All other work sites are fine. Just that this one is the only one in JSP and it is the only one which doesn't work
Do you have any more information on the COM browser? link to an MSDN article?
Re: SHDocVw.InternetExplorer
Add the COM Web Browser control to your Toolbox and then add an instance to your form just like you do any other control. You'll then see what type it is.
Re: SHDocVw.InternetExplorer
I'm trying to add in the reference for the COM Web Browser, but i cannot find it. Where is it located?
Is it under "Choose Items..."?
I can find the Microsoft Web Browser, ieframe.dll, but this doesn't seem to load pages.
Re: SHDocVw.InternetExplorer
yes the ieframe.dll is what you want. Once you add it to the toolbox you can drag an instance to your form and use it like the managed browser control, except it has more functionaility.
Re: SHDocVw.InternetExplorer
Ok, now using the ieframe browser. I cast the document to a HTML document variable called 'content'. My error handler now throws this up:
---------------------------
GLS Office Suite
---------------------------
Please report this error: "Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to class type 'System.Windows.Forms.HtmlDocument'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface." to Martin Whitehurst.
---------------------------
OK
---------------------------
See my code below:
Code:
On Error GoTo main_handler
Dim content As HtmlDocument
text2 = "0"
content = wb_GLS1.Document
MsgBox(content.Body.InnerText)
Dim t = content.Body.InnerText
Is this the correct way of referencing the contents of the browser control?
Re: SHDocVw.InternetExplorer
You are no longer using the WinForms WebBrowser control, so it's Document property is not a WinForms HtmlDocument. You're using an ActiveX control that was created long before the WinForms HtmlDocument class existed. You have to work with the types you've got. The error message says that the Document property is of type mshtml.HTMLDocumentClass, so that's the type you need to use. It's an unmanaged control, so you need to work with unmanaged, i.e. non-.NET, types. You should check out the documentation for MSHTML on MSDN.