Progress bar in CMainframe - how to access??

Hiya i have made a progress bar function in the MainFrame of a SDI, but when i want to use it in the View class, it gives me an assertion problem.
i thought i could just access CMainFrame functions the same as any other function in any class...am i wrong??

i tryed this:
void CFirstView::OnShowProgress
{
CMainFrame *pDoc = 0;
pDoc->ProgressBar(); // calling function

// other code

}

any ideas??
cheers,
grahamoj.

Comments

  • : Hiya i have made a progress bar function in the MainFrame of a SDI, but when i want to use it in the View class, it gives me an assertion problem.
    : i thought i could just access CMainFrame functions the same as any other function in any class...am i wrong??
    :
    : i tryed this:
    : void CFirstView::OnShowProgress
    : {
    : CMainFrame *pDoc = 0;
    : pDoc->ProgressBar(); // calling function
    :
    : // other code
    :
    : }
    :
    : any ideas??
    : cheers,
    : grahamoj.
    :

    You can get a pointer to your main frame window at anytime using this code:
    CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion