Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How do I destroy a CXTDock child window?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I destroy a CXTDock child window?

 Post Reply Post Reply
Author
Message
Lucien View Drop Down
Newbie
Newbie
Avatar

Joined: 21 May 2004
Location: Canada
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucien Quote  Post ReplyReply Direct Link To This Post Topic: How do I destroy a CXTDock child window?
    Posted: 24 September 2004 at 11:06am

I have created a view window that displays an hmlt page. I took the example from GUI_VisualStudio7. Now after showing the html page for a while I want to display an another kind a view (regular dialog view) in the same window.

I haft to find a way to destroy, detach or disable the SetChild(htmlView) function without destroy the parent window otherwise it will not work correctly.

Can someone help me on this?

In my previewWindow.cpp I have:

---------------

int previewWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CXTDockWindow::OnCreate(lpCreateStruct) == -1)

return -1;

// Create the html start page

CPropertiesBarHelpFrame* pHelpFrameWnd;

pHelpFrameWnd = NULL;

pHelpFrameWnd = (CPropertiesBarHelpFrame*)CreateFrameDocView(RUNTIME_CLASS(C PropertiesBarHelpFrame), RUNTIME_CLASS( CPropertiesBarHelpView ) );

SetChild(pHelpFrameWnd);

return 0;

}

Back to Top
Lucien View Drop Down
Newbie
Newbie
Avatar

Joined: 21 May 2004
Location: Canada
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucien Quote  Post ReplyReply Direct Link To This Post Posted: 05 October 2004 at 2:51pm

Got it!

pHelpFrameWnd.DestroyWindow();

Back to Top
Lucien View Drop Down
Newbie
Newbie
Avatar

Joined: 21 May 2004
Location: Canada
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucien Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2004 at 10:32am

I said hourray! to fast. Now a window warning pop's up saying that "A required resource was unavailable" when the focus is set on that window.

Does someone know what extra line of code I should use to resolve this issue?

Back to Top
Lucien View Drop Down
Newbie
Newbie
Avatar

Joined: 21 May 2004
Location: Canada
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucien Quote  Post ReplyReply Direct Link To This Post Posted: 07 October 2004 at 1:10pm

After a few hours of research, it seems to me that the pHelpFramWnd child window is still hooked to the parent even after a destroyWindow() of that child. When the focus is activated, the parent window searches for the html page that was destroyed and the bug "A required resource was unavailable" appears.

What am I missing?

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.