I have an MFC SDI application and I want to send a message from the MainFrm class to the View class. How do you get a view class from an associate MainFrm class in MFC?

The CWinApp-derived class contains a list of CDocTemplate objects. You can iterate through that to find the pointer to CDocument class. From CDocument iterate through the list of CView classes that are attached to the document. I know this seems a long way around to get to the CView class but I think its the only way from CMainFrame.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.