Hi Dimitry and Tech Support,
I do not have OnDestroy(0 function in the MDIFrame window but do I OnDestroy() function in my View window (which is derived from CScrollView). In fact my application is based on your DrawCLI sample application and additional code. The underlying structure for the application should be same. When the View is closed, OnDestroy() function of the View is called and it calls the CScroillView::OnDestroy() function....No suprises there !!
As I said in my earlier post, I have a raw MFC MDI test application that basically does the same thing (except that the UI is very very ugly) and it gets closed normally. Both Frame destructor and View destructor are called. Only time I hae problem is when I used Prof_UI and Matrox ActiveMIL controls inside the MDIChild client area (See next para for further info) .
Matrox control has an option to disply the image on the floating window instead of in the client area of the view. I did change my code to do that and it works OK. The destructor of the View is called and window gets removed from the view. For obvious reason, I cannot let the window float. It should be displayed on the client area of the MDIChild. The following lines of code does the magic of using the view window for displaying the image on the clwint area instead of floating window:
pDisplay->DisplayType = dispUserWindow;
HWND hWndChild;
hWndChild = m_hWnd;
pDisplay->UserWindow = (
long)m_hWnd;Follwoing is the description from their manual about these settings. I hope it will help you find a source of the problem:
1. Display -> UserWindow<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Synopsis<o:p></o:p>
Returns or sets the user window used by the Display control for displaying the image. <o:p></o:p>
[Visual Basic]<o:p></o:p>
Syntax <o:p></o:p>
object.UserWindow [= Long]<o:p></o:p>
[Visual C++]<o:p></o:p>
Syntax <o:p></o:p>
object->UserWindow [= long]<o:p></o:p>
Type description<o:p></o:p>
A long value that specifies the hWnd of the control or form into which you want to display images. <o:p></o:p>
Remark<o:p></o:p>
2. Display ->DisplayType
<o:p></o:p>
Synopsis<o:p></o:p>
Returns or sets the type of display. <o:p></o:p>
[Visual Basic]<o:p></o:p>
Syntax <o:p></o:p>
object.DisplayType [= DispDisplayTypeConstants]<o:p></o:p>
[Visual C++]<o:p></o:p>
Syntax <o:p></o:p>
object->DisplayType [= enum DispDisplayTypeConstants]<o:p></o:p>
Type description<o:p></o:p>
A DispDisplayTypeConstants expression that specifies the type of display. <o:p></o:p>
<TABLE style="mso-cellspacing: 1.5pt" cellPadding=0 border=0>
<THEAD>
<TR style="HEIGHT: 17.25pt">
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 17.25pt; BACKGROUND-COLOR: transparent">
Value<o:p></o:p>
</TD>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 17.25pt; BACKGROUND-COLOR: transparent">
Meaning<o:p></o:p>
</TD></TR></THEAD>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
dispDefaultWindow <o:p></o:p>
</TD>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
Displays in the control’s own window. <o:p></o:p>
</TD></TR>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
dispUserWindow <o:p></o:p>
</TD>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
Displays in a user-specified window. <o:p></o:p>
</TD></TR>
<TR style="HEIGHT: 16.65pt">
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 16.65pt; BACKGROUND-COLOR: transparent">
dispExternalWindow <o:p></o:p>
</TD>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 16.65pt; BACKGROUND-COLOR: transparent">
Displays in an external window created by ActiveMIL. <o:p></o:p>
</TD></TR>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
dispAuxiliary <o:p></o:p>
</TD>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
Displays the image without a surrounding window. <o:p></o:p>
</TD></TR></TBODY></TABLE>
<o:p></o:p>
Remarks<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>