Howdy, Stranger!

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

Categories

Progress bar in CMainframe - how to access??

grahamojgrahamoj Member Posts: 366
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

  • pingpongpingpong Member Posts: 937
    : 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();
  • Shawn CarterShawn Carter Member Posts: 0

    ______ [ http://forcoder.org ] free video tutorials and ebooks about \ R, Go, Python, Scratch, Perl, PHP, Objective-C, Java, C, C#, Swift, Ruby, Assembly, Visual Basic .NET, JavaScript, Visual Basic, MATLAB, PL/SQL, C++, Delphi FoxPro, D, Julia, Lisp, Kotlin, Scala, Hack, Logo, SAS, LabVIEW, Alice, Transact-SQL, F#, Bash, Ada, VBScript, Crystal, Fortran, Erlang, COBOL, Lua, ABAP, Rust, Dart, Awk, Clojure, ML, Apex, Prolog, Scheme \ ____________

Sign In or Register to comment.