0
votes

I am working on a project. It has GUI and i add Start button on it , which is handled by some function. and after clicking on start ,that Gui shows the output. I want to disable that handler function. Whenever i debug that project, start button should automatically started and GUI shows the output.

This is the code of that handler. What should i change or move that function ?

          void CServerSocketDlg::OnBtnStart() 
             {
            UpdateData();

            StartX();
             } 

Need your suggestion. Thanks

1
Please improve your question. - Sivaraman
Why do you want to DISABLE the event handler. It sounds more like you want to automatically call the event handler? - snowdude
yes. automatically call the event handler .. it means i dont need to press Start button. it should be automatically executed. - Nabeel

1 Answers

1
votes

So add something like this in an appropriate location. For example, in a dialog, you could put it in OnInitDialog:

#ifdef _DEBUG
if(IsDebuggerPresent())
{
    /* code here to automatically do whatever you need when a debugger is attached */
}
#endif

This code will only be compiled in the "Debug" versions of the application and will execute only if the application is running under the debugger.