Click here to Skip to main content
15,890,186 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Taskbar icon Pin
Michael Dunn28-May-03 16:00
sitebuilderMichael Dunn28-May-03 16:00 
Generalseraching for keywords in a CString Pin
si_6928-May-03 5:04
si_6928-May-03 5:04 
GeneralRe: seraching for keywords in a CString Pin
jhwurmbach28-May-03 5:47
jhwurmbach28-May-03 5:47 
GeneralRe: seraching for keywords in a CString Pin
si_6928-May-03 5:55
si_6928-May-03 5:55 
GeneralRe: seraching for keywords in a CString Pin
jhwurmbach28-May-03 6:05
jhwurmbach28-May-03 6:05 
GeneralRe: seraching for keywords in a CString Pin
valikac28-May-03 5:49
valikac28-May-03 5:49 
GeneralRe: seraching for keywords in a CString Pin
Anonymous28-May-03 10:17
Anonymous28-May-03 10:17 
GeneralProblem switching from Views Pin
Anonymous28-May-03 5:03
Anonymous28-May-03 5:03 
I have develop an SDI application where I have more that one
CView derived class and I switch them using the following
code:

CView* CMyDoc::SwitchToView(CView* pNewView)<br />
{      <br />
   CFrameWnd* pMainWnd = (CFrameWnd*)AfxGetMainWnd();<br />
   CView* pOldActiveView = pMainWnd->GetActiveView();<br />
   ASSERT(pOldActiveView != NULL);<br />
   ASSERT_VALID(pOldActiveView);<br />
   <br />
   // Must be attached to us<br />
   ASSERT(pOldActiveView->GetDocument() == this);<br />
   <br />
   if(pNewView == pOldActiveView)<br />
   {<br />
      // New view is the actual view<br />
      return NULL;<br />
   }<br />
<br />
   // Set the child window ID of the active view to AFX_IDW_PANE_FIRST.<br />
   // This is necessary so that CFrameWnd::RecalcLayout will allocate<br />
   // this "first pane" to that portion of the frame window's client<br />
   // area not allocated to control bars.  Set the child ID of<br />
   // the previously active view to some other ID.<br />
   ::SetWindowLong(pOldActiveView->m_hWnd, GWL_ID, 0);<br />
   ::SetWindowLong(pNewView->m_hWnd, GWL_ID, AFX_IDW_PANE_FIRST);<br />
<br />
   // Show the newly active view and hide the inactive view.<br />
   pNewView->ShowWindow(SW_SHOW);<br />
   pOldActiveView->ShowWindow(SW_HIDE);<br />
<br />
   // Connect the newly active view to the document, and disconnect the inactive view<br />
   AddView(pNewView); <br />
   RemoveView(pOldActiveView);<br />
   pMainWnd->SetActiveView(pNewView);<br />
   pMainWnd->RecalcLayout();<br />
<br />
   return pOldActiveView;<br />
}


The problem is that windows messages are sent (by the framework)
only to the Default CView derived class (the one created with
Doc and Mainframe classes).
When a change View... the news one doesn't receive any windows
messages.

Which could be the problem ???

Thanks a lot!
QuestionLoad RTF file with pictures in CRichEdit? Pin
Yasen Georgiew28-May-03 4:30
Yasen Georgiew28-May-03 4:30 
AnswerRe: Load RTF file with pictures in CRichEditCtrl? Pin
David Crow28-May-03 4:32
David Crow28-May-03 4:32 
GeneralRe: Load RTF file with pictures in CRichEditCtrl? Pin
Yasen Georgiew28-May-03 4:42
Yasen Georgiew28-May-03 4:42 
QuestionHow can I associate an string value to a group using Active Directory Pin
Braulio Dez28-May-03 4:15
Braulio Dez28-May-03 4:15 
Questionhow to contact u with an attachment Pin
Balaji200028-May-03 3:32
Balaji200028-May-03 3:32 
GeneralData file frustration. Pin
73Zeppelin28-May-03 3:12
73Zeppelin28-May-03 3:12 
GeneralRe: Data file frustration. Pin
David Crow28-May-03 3:15
David Crow28-May-03 3:15 
GeneralRe: Data file frustration. Pin
73Zeppelin28-May-03 3:30
73Zeppelin28-May-03 3:30 
GeneralMFC dialog enigma - please help Pin
Beer28-May-03 3:06
Beer28-May-03 3:06 
GeneralRe: MFC dialog enigma - please help Pin
David Crow28-May-03 3:12
David Crow28-May-03 3:12 
GeneralRe: MFC dialog enigma - please help Pin
Beer28-May-03 4:33
Beer28-May-03 4:33 
GeneralRe: MFC dialog enigma - please help Pin
Hans Ruck28-May-03 4:19
Hans Ruck28-May-03 4:19 
GeneralRe: MFC dialog enigma - please help Pin
Beer28-May-03 4:36
Beer28-May-03 4:36 
GeneralRe: MFC dialog enigma - please help Pin
Hans Ruck28-May-03 4:50
Hans Ruck28-May-03 4:50 
GeneralRe: MFC dialog enigma - please help Pin
Beer28-May-03 4:56
Beer28-May-03 4:56 
GeneralRe: MFC dialog enigma - please help Pin
Beer28-May-03 4:54
Beer28-May-03 4:54 
General(ADSI) Active Directory... Pin
Braulio Dez28-May-03 2:59
Braulio Dez28-May-03 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.