CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2012
    Location
    chinese
    Posts
    9

    Unhappy A unbelievable breakpoint

    env : vs 2005
    lan : c++
    os : xp

    During I using vs2005 to develop a program,I encounter a very strange problem,detail:
    when i create a button called "IDC_BTN_LOG",the create action:
    //画日志按钮
    m_logBtn.Create(NULL,WS_CHILD | WS_VISIBLE ,CRect(560,150,560+65,150+65),this,IDC_BTN_LOG);
    m_logBtn.SetImage(IDB_BITMAP_LOGNORMAL,IDB_BITMAP_LOGHOVER,IDB_BITMAP_LOGDOWN,IDB_BITMAP_CLOSENORMAL);

    the message map:
    ON_BN_CLICKED(IDC_BTN_LOG, &CMarsWatchingDlg::OnBnClickedLog)

    the reaction function:
    void CMarsWatchingDlg::OnBnClickedLog()
    {
    // TODO: 在此添加控件通知处理程序代码
    CLogDlg dlg1;
    dlg1.DoModal();
    }

    and then I add a breakpoint at here:
    void CMarsWatchingDlg::OnBnClickedLog()
    {
    // TODO: 在此添加控件通知处理程序代码
    * CLogDlg dlg1;
    dlg1.DoModal();
    }

    at the position "*",when i click button IDC_BTN_LOG,i want they jump to the function OnBnClickedLog(),but an unbelievable situation occur,the jump to
    void CMarsWatchingDlg::OnBnClickedLog()
    {
    // TODO: 在此添加控件通知处理程序代码
    CLogDlg dlg1;
    dlg1.DoModal();
    }

    void CMarsWatchingDlg::OnBnClickedConfig()
    {
    // TODO: 在此添加控件通知处理程序代码
    CConfigDlg dlg1;
    dlg1.DoModal();
    }

    void CMarsWatchingDlg::OnBnClickedUpdate()
    {
    // TODO: 在此添加控件通知处理程序代码
    -> CUpdateDlg dlg1;
    dlg1.DoModal();
    }

    here "->",i have no idea why they jump to there?So i clear the obj,and then recompile,and then this situation occur again,does someone encounter this situation?
    I need help,Thanks very much.....
    Attached Images Attached Images     

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: A unbelievable breakpoint

    1. Check if you have unique (button) resource IDs in resource.h file.
    2. Be sure you are working with a DEBUG build configuration.
    3. Be sure you have disabled compiler optimizations (/Od).
    Last edited by ovidiucucu; March 28th, 2012 at 01:51 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Feb 2012
    Location
    chinese
    Posts
    9

    Unhappy Re: A unbelievable breakpoint

    First thank for you attention...

    yes,this resource ID is unique in resource.h file.
    and I am working in the DEBUG mode,compile optimizations is disable

    occasionally i found if i copy this program to another machine,and it works well
    .....these two machine have same environment(vs2005)...this situation bother me for
    several days ,does somebody can help me..
    Attached Images Attached Images  

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: A unbelievable breakpoint

    Try to delete .ncb, .opt, .aps files.
    Then try to Rebuild All
    Victor Nijegorodov

  5. #5
    Join Date
    Feb 2012
    Location
    chinese
    Posts
    9

    Re: A unbelievable breakpoint

    Thx,yesterday night,i reinstalled my os,and then the problem disappeared,so i have no idea about whether the .ncb, .opt and .aps files cause this problem
    But still thanks all

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: A unbelievable breakpoint

    Quote Originally Posted by charles_ch View Post
    Thx,yesterday night,i reinstalled my os,and then the problem disappeared,so i have no idea about whether the .ncb, .opt and .aps files cause this problem
    Before blowing up your computer or simply reinstalling everything, it's good to try first less radical solutions like the one suggested by Victor.
    What about if that will happen again tomorrow?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Apr 2012
    Posts
    29

    Re: A unbelievable breakpoint

    I know this thread has been pretty out-of-date up to now. But it makes me smile to wonder if the installation of a large application such as Visual Studio can damage the OS itself. What a little surprise!

  8. #8
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: A unbelievable breakpoint

    Quote Originally Posted by thefollower View Post
    I know this thread has been pretty out-of-date up to now. But it makes me smile to wonder if the installation of a large application such as Visual Studio can damage the OS itself. What a little surprise!
    No, the instalation or a large application such as Visual Studio CANNOT damage the Windows OS itself.

    [ Later edit ]
    Smile in your dreams!
    Last edited by ovidiucucu; April 16th, 2012 at 02:58 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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