LPDISPATCH getViewWithIndex(int index)
This method retrieves the ViewAPI object of the view with the given index. Views are indexed from 0 to n, where 0 is the index of the first view opened, 1 is the index of the next view opened, etc. If the ith view is closed, all view indices above “i” move down one.
The method is used as shown below.
In VC++, allocated on the heap (assuming vwMngrAPI is a pointer to the ViewMngrAPI):
IViewAPI* vwAPI = new IViewAPI;
vwAPI->m_lpDispatch = vwMngrAPI->getViewWithIndex(i);
In VC++, on the stack (assuming vwMngrAPI is a pointer to the ViewMngrAPI):
vwAPI.m_lpDispatch = vwMngrAPI->getViewWithIndex(i);
In VB (assuming vwMngrAPI is a ViewMngrAPI object):
In the declarations:
Public vwAPI As Object
Private vwAPI As Object
Set vwAPI = vwMngrAPI.getViewWithIndex(i)
The client receives an instance of this object shared by other clients, if any.