Click here to Skip to main content
15,886,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralAMD64 and MFC Pin
Robert Buldoc25-Feb-04 15:12
Robert Buldoc25-Feb-04 15:12 
GeneralRe: AMD64 and MFC Pin
Michael Dunn25-Feb-04 15:15
sitebuilderMichael Dunn25-Feb-04 15:15 
GeneralRe: AMD64 and MFC Pin
Robert Buldoc25-Feb-04 15:16
Robert Buldoc25-Feb-04 15:16 
GeneralAccess CFormView vars from CMainFrame Pin
Daniel132425-Feb-04 12:02
Daniel132425-Feb-04 12:02 
GeneralRe: Access CFormView vars from CMainFrame Pin
ian mariano25-Feb-04 12:18
ian mariano25-Feb-04 12:18 
GeneralRe: Access CFormView vars from CMainFrame Pin
Daniel132425-Feb-04 13:10
Daniel132425-Feb-04 13:10 
GeneralRe: Access CFormView vars from CMainFrame Pin
Steve S25-Feb-04 22:47
Steve S25-Feb-04 22:47 
GeneralRe: Access CFormView vars from CMainFrame Pin
ian mariano26-Feb-04 1:02
ian mariano26-Feb-04 1:02 
Steve S is right, Daniel. It actually makes things easier than handling WM_CLOSE in the Main Frame, although that's perfectly OK as well...

Just inject the check on your CFormView derived View's CanCloseView() (or whatever you call it) into your override of CanCloseFrame():

BOOL  CMyDocument::CanCloseFrame(CFrameWnd* pFrame)
{
   //  check your view first
   CMyFormView  pView = (CMyFormView)pFrame->GetActiveView();

   if (FALSE == pView->CanCloseView())   return FALSE;

   //  ok, since it's OK to close after that check, call the base implementation
   return CDocument::CanCloseFrame(pFrame);
}


Ian Mariano - http://www.ian-space.com/


"We are all wave equations in the information matrix of the universe" - me

GeneralString Question Pin
USMCmaggot25-Feb-04 11:29
USMCmaggot25-Feb-04 11:29 
GeneralRe: String Question Pin
Daniel132425-Feb-04 11:46
Daniel132425-Feb-04 11:46 
GeneralRe: String Question Pin
Wes Aday25-Feb-04 11:53
professionalWes Aday25-Feb-04 11:53 
GeneralHeapAlloc bombing Pin
TimWallace25-Feb-04 11:26
TimWallace25-Feb-04 11:26 
GeneralRe: HeapAlloc bombing Pin
Ravi Bhavnani25-Feb-04 12:15
professionalRavi Bhavnani25-Feb-04 12:15 
GeneralRe: HeapAlloc bombing SOLVED Pin
TimWallace26-Feb-04 5:16
TimWallace26-Feb-04 5:16 
GeneralCalling MFC from managed C++ Pin
jbmeeh25-Feb-04 10:41
jbmeeh25-Feb-04 10:41 
GeneralMSDN Pin
v0id_dev25-Feb-04 10:30
v0id_dev25-Feb-04 10:30 
GeneralRe: MSDN Pin
ian mariano25-Feb-04 12:23
ian mariano25-Feb-04 12:23 
QuestionRandom number? Pin
LudaLuda25-Feb-04 9:56
LudaLuda25-Feb-04 9:56 
AnswerRe: Random number? Pin
Christian Graus25-Feb-04 10:12
protectorChristian Graus25-Feb-04 10:12 
AnswerRe: Random number? Pin
John M. Drescher25-Feb-04 11:13
John M. Drescher25-Feb-04 11:13 
GeneralCalcFixedLayout and CalcDynamicLayout Pin
ozamgal25-Feb-04 9:06
ozamgal25-Feb-04 9:06 
GeneralMicrosoft SDK/DDK for AMD64 Pin
Alexander M.,25-Feb-04 9:04
Alexander M.,25-Feb-04 9:04 
GeneralRe: Microsoft SDK/DDK for AMD64 [EDITED] Pin
John M. Drescher25-Feb-04 11:19
John M. Drescher25-Feb-04 11:19 
GeneralRe: Microsoft SDK/DDK for AMD64 Pin
John M. Drescher25-Feb-04 11:25
John M. Drescher25-Feb-04 11:25 
GeneralCheat Pin
Anonymous25-Feb-04 6:00
Anonymous25-Feb-04 6:00 

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.