Home > Software engineering >  MFC drawing document management
MFC drawing document management

Time:02-08

Now meet a problem, while creating more docs, in the View class to scale map View, also added a zoom function function; After create a new document, scaling on any document for operation, other documents in the view also has the same operation (scaling) together; Condensation do I view in the current document drawing change does not affect the other document in the view; Please, help me answer the; Because before I do. NET development, fully object-oriented; Now project needs require written in MFC project, has quite different concept;

CodePudding user response:

You can filter the currently active view, if not directly filtered out,

 CMDIFrameWnd * pFrame=(CMDIFrameWnd *) AfxGetApp () - & gt; GetMainWnd (); 

//Get the active MDI child window.
CMDIChildWnd * pChild=(CMDIChildWnd *) pFrame - & gt; GetActiveFrame ();

//or CMDIChildWnd * pChild=pFrame - & gt; MDIGetActive ();

//Get the active view attached to the active MDI child window.
CMyView * pView=(CMyView *) pChild - & gt; GetActiveView ();
  • Related