Losing the Document in a SDI application
From: Phillip N Rounds (prounds_at_cassandragroup.com)
Date: 05/04/04
- Next message: Neel Roy: "Re: Losing the Document in a SDI application"
- Previous message: TVR Fan: "Dockable tool bars with scrollbars if larger than parent frame"
- Next in thread: Neel Roy: "Re: Losing the Document in a SDI application"
- Reply: Neel Roy: "Re: Losing the Document in a SDI application"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 4 May 2004 11:15:31 -0400
I have a fairly complicated SDI application which recently has had the
problem that it, at times, looses the document.
Basic architecture is
SDI, with a splitter window.
The Document has three views:
View1 is always present in Pane(0,0) of the splitter.
View2 and View3 are presented in Pane(0,1) of the splitter, with the
Mainframe handling the switching between the two.
The application has a serial connection to a piece of lab equipment. We
have a threaded serial communication class, which posts a message when data
is received. When the RECEIVED message is posted, the Mainframe reads the
data and stores it in an array for later processing.
The Mainframe invokes WM_TIMER, with two timers: One at one second to
refresh the views with current data, the second at (variably) specified
intervals to process the data. Data gets initial processing in the
Mainframe, then put into the Doc.
The two views are as follows: View1 is a CView, which is used to present a
graphical representation of the data. View2 is a CListView
to present the data in tabular form. Printing is handled within the views,
in View1 by passing a CPrinterDC to the OnDraw() method.
View2 prints with formatted printing of the data to the printer.
All of this is probably irrelevant, but what the hell.
The problem is that the app will hang at random times. In debugging this,
the problem is always that the Mainframe loses the document.
CMyDocument* pDoc = CMyMainFrame::GetActiveDocument();
results in pDoc = NULL
I have added the m_bAutoDelete = false to the CMyDocument constructor, and
it made no difference.
I put a trace into the CMyDocument destructor to see when that was being
called, and it never was.
Any guesses as to how this may be happening?
Thanks
-- Phillip N Rounds The Cassandra Group, Inc 68 Sand Hill Rd Flemington NJ 08822 prounds@cassandragroup.com
- Next message: Neel Roy: "Re: Losing the Document in a SDI application"
- Previous message: TVR Fan: "Dockable tool bars with scrollbars if larger than parent frame"
- Next in thread: Neel Roy: "Re: Losing the Document in a SDI application"
- Reply: Neel Roy: "Re: Losing the Document in a SDI application"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|