CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: How to use CEdit Control variable updated from a tab to the dialog box ?

    IMO it's good practice to define the number of elements in a fixed size array (even those created via new) as constants (const int) near the top of the program and then use these constants when the array is defined and iterated (use < rather than <=). That way you stand less chance of accessing (and modifying!) non-existent array elements. It also makes it easier to see what are the sizes of arrays without having to trawl through the program trying to find them!

    IMO it is also not a good idea to allocate memory in one place and then have to remember to free it up somewhere else. Where possible use RAII and put allocation in the constructor and free in the destructor
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  2. #17
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: How to use CEdit Control variable updated from a tab to the dialog box ?

    Quote Originally Posted by Mendeln View Post
    I don't know either how to use debugger to find this bug.
    Make sure you are in Debug configuration.
    Place the cursor on your line:
    Code:
    GainExTimeF = SettingsTab.ModeCustom(k);
    and hit F5.
    When you "break" into debugger, use F11 to step into the function or F10 - to step over.
    See how far you get...
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

Page 2 of 2 FirstFirst 12

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