Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protected member access, that's not protected

Status
Not open for further replies.

pdunncs

Technical User
Jun 21, 2003
12
US
I have a problem with my MDI. I have three views. Two are CHtmlViews and when one of the CHtmlView (View2) is clicked; it is suppose to call the other CHtmlView (View1) to go to that website. I have in the CApp class the global variable theApp and a public class GetHtmlView(). GetHtmlView goes through the active frames until View1 is found and return a pointer to it. The problem that I get is

'CApp::GetHtmlView' : cannot access protected member declared in class 'CApp'
: see declaration of 'CApp::GetHtmlView'
: see declaration of 'CApp'

This is CApp::GetHtmlView declaration

CActWin* GetHtmlView();

This is CApp declaration

public CApp : public CWinApp

I have no protected members inside of CApp.
This is where I get the error inside of View2

CActWin* pActWin1 = theApp.GetHtmlView();
pActWin1->Navigate2(lpszURL,NULL,NULL);

The theApp is global like previously stated

extern CApp theApp;

Off topic, but does anyone know the best solution for when View2 is clicked and I don't want View2 to navigate to that website that was clicked on. I used in the OnBeforeNavigate2(); Navigation("current html", NULL, NULL). I just think there should be a better way to prevent View2 from going to another site.

Thanks for any help
 
The doc/view way of doing things is:

1) A view gets some input.
2) The view change som state in the document
3) The view tell the document to update all views
4) All (other) views are updated and do what thay gotta do.

It is the document that owns the views, not the app.


/Per
[sub]Nerdy signatures are as lame as the inconsistent stardates of STTNG.[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top