NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

IDispatchPtr to CHtmlView

I am not sure if this is the right place to even ask this question but here goes...

I want to display an .html in the reportview activeX control. I know that I get the handle to the webbrowser via the GetHTMLCtrl method. This returns a IDispatchPtr. I know the methods for controlling the browser is found in the CHtmlView class. What would I need to do to convert (or cast) the IDispatchPtr to be able to use it with the CHtmlView class?

Many thanks in advance,
smith
0 Kudos
Message 1 of 2
(3,826 Views)
Hi

Here is the code you will use to update the WebBrowser control you get from ReportView to display .html file.

IWebBrowser2Ptr spBrowser = static_cast(m_rptView.GetHTMLCtrl());
if(spBrowser)
{
COleVariant vaURL("http://www.ni.com") ;
COleVariant vaEmpty;
spBrowser->Navigate2(vaURL,vaEmpty,vaEmpty,vaEmpty,vaEmpty) ;
}

However, I am not sure you need to do that, depending on what you trying to do.

If you look at the Operator Interfaces, which are shipped with TestStand 3.0, the ReportView control is connected to an executionViewMgr and when the report object is updated in your execution ( by calling Report.Reset), the reportView automatically display the current contents of the report in the report Object.

If you would l
ike to update the reportView with the current report without using the executionViewMgr you can call ReportView.UpdateFromExecution when you handle the UIMsg_DisplayReport UIMsg. You can also update the report at the end of execution by handling UIMsg_EndExecution UIMsg.

I hope this helps.
Regards
Anand Jain
0 Kudos
Message 2 of 2
(3,826 Views)