Problem with MSVC debugger - can't get it to break?

This is a discussion on Problem with MSVC debugger - can't get it to break? within the Windows Programming forums, part of the Platform Specific Boards category; I'm creating an MFC based dialog program. One Dialog has a button that launches a second modal dialog with a ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    72

    Problem with MSVC debugger - can't get it to break?

    I'm creating an MFC based dialog program. One Dialog has a button that launches a second modal dialog with a simple function - looks like this:
    Code:
    void CFrameDlg::OnBnClickedPreview()
    {
    	CPreviewDlg Dlg;
    	Dlg.DoModal();
    }
    I want to step through functions in the CPreviewDlg class, but if I put a breakpoint in the CPreviewDlg class, it never breaks. If I put a breakpoint in the above function (which is in the main dialog), it never breaks. How to I make it break?

  2. #2
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Make sure you're debugging the program and not simply running it.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    72
    Quote Originally Posted by The Dog
    Make sure you're debugging the program and not simply running it.
    I am definitely debugging.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Quote Originally Posted by BrianK
    I'm creating an MFC based dialog program. One Dialog has a button that launches a second modal dialog with a simple function - looks like this:
    Code:
    void CFrameDlg::OnBnClickedPreview()
    {
    	CPreviewDlg Dlg;
    	Dlg.DoModal();
    }
    I want to step through functions in the CPreviewDlg class, but if I put a breakpoint in the CPreviewDlg class, it never breaks. If I put a breakpoint in the above function (which is in the main dialog), it never breaks. How to I make it break?
    Try putting it in the CPreviewDlg constructor and see if it ever gets created. Also just try setting some breakpoints in WinMain to make sure those are getting hit. It may just be that the method is never getting called.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help problem in winsock code
    By lolguy in forum C Programming
    Replies: 8
    Last Post: 02-12-2009, 06:33 PM
  2. Help it won't compile!!!!!
    By esbo in forum C Programming
    Replies: 58
    Last Post: 01-04-2009, 02:22 PM
  3. Replies: 27
    Last Post: 10-11-2006, 04:27 AM
  4. Keypress reading
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 06-16-2004, 12:16 PM
  5. Tic - Tac - Toe...
    By TheUnknowingOne in forum Game Programming
    Replies: 1
    Last Post: 09-10-2002, 06:01 AM

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