Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: VB OCX crashes when MFC App attempts to exit


Message #1 by "Bryan Welton" <b_welton@y...> on Wed, 26 Feb 2003 15:50:18
Hello Bryan,

probably the problem is in the DestroyWindow method; it is possible that
it destroys the window without the house keeping necessary for a 
user control. I added flexgrid to MFC containers using CreateControl,
but I never used DestroyWindow. I just let the grid take care of
itself and it works ok.

BTW what do you mean for "(this doesn't have the effect of unloading
the cx files)."

Let me know,
Marco

> Hi,

> I have written a VB OCX which itself uses Microsoft's MSCOMCTL.OCX 
(> version 6.0.88.62).

> This OCX is used within an MFC container, loaded using 
C> Wnd::CreateControl, the OCX display is then removed from the container 
u> sing CWnd::DestroyWindow (this doesn't have the effect of unloading the 
o> cx files).

> When the container is then closed, AfxGetApp()->ExitInstance();, I get a 
c> rash. The Stack Frame ends up in MSCOMCTL.

> I can run the OCX in a VB container without any problems.

> Any advice appreciated,
B> ryan Welton

  Return to Index