locked
Breakpoint on App::OnLaunched does not break

    Question

  • In a simplistic application, when setting the breakpoint on OnLaunched, it never gets there:

     

    //
    // App.xaml.cpp
    // Implementation of the App.xaml class.
    //
    
    #include "pch.h"
    #include "App.xaml.h"
    #include "MainPage.xaml.h"
    using namespace Windows::UI::Xaml;
    using namespace HelloWinRTFromCpp;
    
    using namespace Windows::ApplicationModel::Activation;
    
    App::App()
    {
        InitializeComponent(); <-- It gets here
    }
    
    App::~App()
    {
    }
    
    void App::OnLaunched(LaunchActivatedEventArgs^ pArgs)
    {
        Window::Current->Content = ref new MainPage(); <-- but not here
        Window::Current->Activate();
    }
    

    Friday, October 28, 2011 5:26 AM

All replies

  • Which template did you choose to build your app?  And how are you activating your app?  just F5 in the debugger?
    Friday, October 28, 2011 7:05 PM
  • I used the Visual C++ | Windows Metro Style | Application template.  This is the simplest application template. Debugging is set to Local Debugger.  That's what is activated when I hit F5 
    Friday, October 28, 2011 9:23 PM
  • I have experienced situations where the breakpoint is indeed hit but the OS does not switch you to the desktop window, so you are stuck staring at the metro-desktop wondering what's happening. If you manually switch to the classic desktop, you may find VS 2011 waiting for you with the breakpoint hit.
    http://blog.voidnish.com
    Friday, October 28, 2011 10:27 PM
  • Been there.  No breakpoint hit.  I looked at some of the recommendations on the Internet to no avail.  I'll move to a different machine, but so far it's happening on two of them--VirtualBox.
    Friday, October 28, 2011 11:08 PM
  • Can you verify whether the debugger is still attached by manually breaking? Perhaps the debugger is freezing up for some reason.

     

    I know the earlier breakpoint worked. So I am assuming that it's a little later that the debugger dies on you.


    http://blog.voidnish.com
    Friday, October 28, 2011 11:11 PM
  • Any update to Nishant's question? Once you hit your first breakpoint, how far do you get if you F10 from that point forward?

     

    Thanks,

    -David

    Tuesday, November 01, 2011 5:03 PM
    Moderator