CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    44

    Cant Describe It?

    I am calling multiple dialog's from my SDI view Class , the problem is that i get an assertion failure when i call my dialog for the second time. I traced the problem to the following code, written on InitDialog.

    m_tip.Create(this)

    This is a MFC tooltip class taken from code guru! I have tried to destroy the object m_tip , i have tried to destroy the window but nothing seems to work ... Could somebody help me !!


  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: Cant Describe It?

    I presume m_tip is a CWnd derived class....
    You could check to see if it has already been createdif ( !::IsWindow(m_tip.m_hWnd) )
    m_tip.Create(this);

    Or if you need to force the window to destory you could try something like this:if ( ::IsWindow(m_tip.m_hWnd) )
    {
    HWND hWnd = m_tip.Detach();
    if ( hWnd )
    :estroyWindow(hWnd);
    }
    m_tip.Create(this)

    You might beed to play around with it a bit, but this should be the general idea.




  3. #3
    Join Date
    Apr 1999
    Posts
    44

    Re: Cant Describe It?

    Thanx for your advice , i will try it out...
    But i have another problem too! I have succesfully displayed a toolbar in a dialog box but the second time i call the dialog box the LoadToolbar functions returns an error. Although the program functions normally but the toolbar images are not loaded!
    Can you help me ????


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured