Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A tricky one :o) Pin
RaulGonzalez29-Dec-02 16:41
RaulGonzalez29-Dec-02 16:41 
GeneralRe: A tricky one :o) Pin
Michael Dunn29-Dec-02 16:43
sitebuilderMichael Dunn29-Dec-02 16:43 
GeneralRe: A tricky one :o) Pin
Nick Parker29-Dec-02 16:49
protectorNick Parker29-Dec-02 16:49 
GeneralRe: A tricky one :o) Pin
Nick Parker29-Dec-02 16:45
protectorNick Parker29-Dec-02 16:45 
GeneralRe: A tricky one :o) Pin
RaulGonzalez29-Dec-02 16:50
RaulGonzalez29-Dec-02 16:50 
GeneralRe: A tricky one :o) Pin
Nick Parker29-Dec-02 17:12
protectorNick Parker29-Dec-02 17:12 
GeneralRe: A tricky one :o) Pin
RaulGonzalez29-Dec-02 17:36
RaulGonzalez29-Dec-02 17:36 
GeneralClosing only one of several documents Pin
trimtrom29-Dec-02 16:10
trimtrom29-Dec-02 16:10 
Hello,
I am a beginner MFC programmer with a problem. I am writing an SDI application where I have more than one document template, each with different frame windows, documents and views. I am in a situation where I have two frame windows open, and I am trying to close only the second one.

I am getting obscure errors when I use CFrameWnd::OnClose() to close the window, mainly I think because the document isn't closing properly, and I still have a document pointer to the active view open. It was set originally as follows:

int CNewMsgFormView::OnCreate(LPCREATESTRUCT lpCreateStruct) {
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
GetDocument()->m_pFormView = this;
return 0;
}

I can stop the errors by removing the "GetDocument()" line, but I need that link for my code in CNewMsgFormView. I haave tried deleting the pointer in a destructor but it makes no difference to the errors.

However, if I use GetDocument()->OnCloseDocument() from this view, it closes ALL the frame windows! I need either to close just the one document/window, or a way of deleting the above pointer in the document. I would be very grateful for any ideas....

Thanks,
Trimtrom

GeneralRe: Closing only one of several documents Pin
Michael Dunn29-Dec-02 16:41
sitebuilderMichael Dunn29-Dec-02 16:41 
GeneralStatic Memeber Problem Pin
29-Dec-02 14:31
suss29-Dec-02 14:31 
GeneralRe: Static Memeber Problem Pin
Nitron29-Dec-02 15:02
Nitron29-Dec-02 15:02 
GeneralRe: Static Memeber Problem Pin
Michael Dunn29-Dec-02 16:04
sitebuilderMichael Dunn29-Dec-02 16:04 
GeneralMaking folder invisible (advanced) Pin
Member 20681029-Dec-02 14:11
Member 20681029-Dec-02 14:11 
GeneralRe: Making folder invisible (advanced) Pin
Andreas Saurwein30-Dec-02 6:58
Andreas Saurwein30-Dec-02 6:58 
QuestionCould someone please guide me with my code a litlle? Pin
georgiek5029-Dec-02 13:58
georgiek5029-Dec-02 13:58 
GeneralNew to Programming Pin
bmwmpower29-Dec-02 13:21
bmwmpower29-Dec-02 13:21 
GeneralRe: New to Programming Pin
Taka Muraoka29-Dec-02 13:31
Taka Muraoka29-Dec-02 13:31 
GeneralRe: New to Programming Pin
Rob Graham29-Dec-02 13:59
Rob Graham29-Dec-02 13:59 
GeneralRe: New to Programming Pin
berdj@sympatico.ca31-Dec-02 13:28
sussberdj@sympatico.ca31-Dec-02 13:28 
GeneralRe: New to Programming Pin
(Steven Hicks)n+129-Dec-02 15:54
(Steven Hicks)n+129-Dec-02 15:54 
GeneralKiss for free books Pin
Linda1029-Dec-02 12:03
Linda1029-Dec-02 12:03 
GeneralRe: Kiss for free books Pin
zarzor29-Dec-02 12:19
zarzor29-Dec-02 12:19 
GeneralRe: Kiss for free books Pin
Jim Crafton29-Dec-02 13:03
Jim Crafton29-Dec-02 13:03 
GeneralRe: Kiss for free books Pin
Taka Muraoka29-Dec-02 13:33
Taka Muraoka29-Dec-02 13:33 
GeneralRe: Kiss for free books Pin
Linda1029-Dec-02 14:41
Linda1029-Dec-02 14:41 

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.