problem with MFC application

This is a discussion on problem with MFC application within the Windows Programming forums, part of the Platform Specific Boards category; I have no experience with MFC. I found program on the interten that could help me with my studies. I ...

  1. #1
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    712

    problem with MFC application

    I have no experience with MFC. I found program on the interten that could help me with my studies. I decided to change it a little, but problems come up. Program is a dialog application and uses 2 sliders that are connected to teht fields and problebly some other things. Connected means when set text field slider is moved. That slider are notr necessary and when I try to delete them by simply deleting from dialog form program crushes at runtime. It appears problem is in other file that I don't see in my solution explorer (Visual C++ .net) from example
    in dlgdata.cpp
    Code:
    HWND CDataExchange::PrepareCtrl(int nIDC)
    {
    	ASSERT(nIDC != 0);
    	ASSERT(nIDC != -1); // not allowed
    	HWND hWndCtrl;
       COleControlSite* pSite = NULL;
    	m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
    	if (hWndCtrl == NULL)
    	{
    	  // Could be a windowless OCX
    	  pSite = m_pDlgWnd->GetOleControlSite(nIDC);
    	  if (pSite == NULL)
    	  {
    		   TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
    		   ASSERT(FALSE);//here's breakpoint
    		   AfxThrowNotSupportedException();
    	  }
    	}
    	m_idLastControl = nIDC;
    	m_bEditLastControl = FALSE; // not an edit item by default
    
       return hWndCtrl;
    }
    in winocc.cpp

    Code:
    		return m_pCtrlSite->ModifyStyleEx(dwRemove, dwAdd, nFlags);
    }
    
    void CWnd::SetWindowText(LPCTSTR lpszString)
    {
    	ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
    //again on ASSERT
    	if (m_pCtrlSite == NULL)
    		::SetWindowText(m_hWnd, lpszString);
    	else
    		m_pCtrlSite->SetWindowText(lpszString);
    }
    and in cther files.
    I really don't have clue what is happening and would like to asike if someone who is good with MFC is willing to send him project by email to look this.

    Thank you

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Remove all code that contains the slicer resource ID.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a Dialog Based Application without MFC
    By MitchellH in forum C++ Programming
    Replies: 8
    Last Post: 05-21-2005, 10:02 AM
  2. MFC Multi-threading is working ... Now another problem :(
    By SyntaxBubble in forum Windows Programming
    Replies: 3
    Last Post: 11-13-2003, 07:39 PM
  3. c and MFC problem
    By lwong in forum Windows Programming
    Replies: 3
    Last Post: 10-29-2003, 10:30 PM
  4. PowerPoint and OLE Server and MFC problem
    By gicio in forum Windows Programming
    Replies: 0
    Last Post: 08-21-2003, 02:46 AM
  5. Problem with mfc?
    By joerghamster in forum C++ Programming
    Replies: 1
    Last Post: 07-16-2003, 07:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21