-
June 24th, 2014, 02:06 PM
#16
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)
-
June 24th, 2014, 04:35 PM
#17
Re: How to use CEdit Control variable updated from a tab to the dialog box ?
Originally Posted by Mendeln
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|