Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calling CFrameWnd member function from CWndApp's OnIdle()?

Posted on 1999-07-14
3
Medium Priority
?
545 Views
Last Modified: 2013-11-20
I wish to call a member function derived from CFrameWnd from
the OnIdle() member function derived from CWinApp. Give me a clue.
0
Comment
Question by:b_bowden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 60 total points
ID: 1309960
Get the pointer to frame window in app class.. and call its function....

BOOL CGridApp::OnIdle(LONG lCount)
{
      CWnd *pWnd = AfxGetMainWnd ();
      CFrameWnd *pFrame = static_cast<CFrameWnd *>(pWnd);
      if (pFrame != NULL) {
//            AfxMessageBox (_T ("Call function on frame!"));
      }
    return CWinApp::OnIdle(lCount);
}
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1309961
From your application class' OnIdle() try this:
((CFrameWnd*)m_pMainWnd)->YourFunctionInFrame();

thanks
pagladasu

0
 

Author Comment

by:b_bowden
ID: 1309962
Thanks
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question