|
"Debug" and "Release" are different configurations under which you can produce the final executable from your project files. Debug .EXEs are meant to be used in the debugging process, while release .EXEs do not have any such debugging aids and are typically smaller and faster. When compiling in debug mode, the macro _DEBUG is defined, while in release mode it is NDEBUG which is defined (also, _DEBUG is not defined in release mode, of course). Some of the debugging aids included in a debug executable are:- Debugging versions of the functions in the C run-time library that check for common errors like passing null pointers, memory leaks, etc.
- Macros such as
assert are included in the executable.
- Information is included that gives you the possibility to set breakpoints, watch the contents of variables in run-time, do step-by-step running, etc.
- The code is not optimized to preserve a mapping between source code and generated machine code. In release mode, a lot of optimizations are applied that frequently reverse the order of sentences, eliminate temporary variables, an so on.
So, use debug mode when testing your program and release when giving it away.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín's reply explains the differences between Debug and Release mode very well. I'd just add that if you execute code (that must run in release mode) using ASSERT , you should change it to VERIFY . Eg:
ASSERT (x > 0);
ASSERT (myFunction (x) == SUCCESS);
should be
ASSERT (x > 0);
VERIFY (myFunction() == SUCCESS);
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Does anyone know how can I get the information about the avaible dial-up connection accounts of a computer? I need to get the phone number and the username for all the avaible dial-up accounts.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
|
|
|
|
|
Sure. Use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rasclnt_3rar.asp">RasEnumConnections</a> to get a list of available connections. To retrieve number and user, use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rasclnt_4boz.asp">RasGetEntryProperties</a> and <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rasclnt_681f.asp">RasGetEntryDialParams</a> , respectively.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've got only october's MSDN issue where the quite little information is given on how to use that "Visual Styles API". Can anyone give a link to some detailed manual???
konst
|
|
|
|
|
|
Are you joking? There's nothing useful. Do you think that that writing can really help to make the program like "Style XP" !?
konst
|
|
|
|
|
|
I want to create .mak file.
how do i write it , it should be able to compile all my .c files
and run the program
|
|
|
|
|
If you are starting from a regular Visual C++ project, the command Project -> Export Makefile... generates an equivalent .mak file that you can later edit and polish up to meet your needs (basically, adding automatic execution after build, I guess).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
How I can run addIns in debug version ?
I use VC++ 6.
Thanks!
User
|
|
|
|
|
This is an extract from the WndTabs v2.5 addin help file:
"To debug a DevStudio Add-In, you must load DevStudio with the Add-In disabled (i.e., go to Tools|Customize|Add-Ins and disable the add-in). When you load DevStudio the next time, the add-in will not be in memory, so you will be able to overwrite the .dll file when you compile the project.
After the compilation, execute the program. Since the add-in is nothing more than a .dll, you will be prompted for a program to run. Specify the full path to MSDEV.EXE. You'll get a warning message specifying that your program has no debugging information, because MSDEV.EXE itself has none. This warning can be safely ignored.
Once MSDEV.EXE is running under the debugger, you can reactivate the add-in from the Tools|Customize|Add-Ins dialog. The add-in will be loaded with it's debugging information (if you compiled a Debug build), and you should be able to set breakpoints and debug at will. The next time you run MSDEV.EXE from the project workspace, the add-in will get loaded with it automatically."
Gavin
|
|
|
|
|
from CHtmlView or WebBrowser control?
I need AddNamedItem() badly.
OutlookExpress seems to be able to do that
function updateAccountInfo()
{
if (OutlookExpress.mailAccounts != null)
{
szUser = OutlookExpress.userName;
cMail = OutlookExpress.mailAccounts;
cNews = OutlookExpress.newsAccounts;
}
else
{
szUser = "";
cMail = 1;
cNews = 1;
}
....
|
|
|
|
|
hello, for the past week ive been building a tictactoe program and while building it, i have encountered alot of bugs and errors. is there any technique i can use to find bugs besides usings assert statement. well, anyways, thank you for ur help...
|
|
|
|
|
|
Hi!
Write slow, even if You can write fast, double check functions/methods/algos.
Review code You have recently wrote, test often (from user point of view - use release
version), etc.
It is better to write 50% slower and generate less errors, than write fast generate many errors, and then spend huge amount of time on corrections.
(of course, those are my opinions)
Mukkie
|
|
|
|
|
It is better to write 50% slower and generate less errors, than write fast generate many errors, and then spend huge amount of time on corrections.
(of course, those are my opinions)
But very valid ones. Bugs are can be very expensive to fix.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I have a lot of problem especially on windows 2000 to set focus input to windows in a multithread context (several threads manage windows)
I have found this remark in an MSDN article concerning SetForegroundWindow function :
Windows NT 5.0 and later: An application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see SetActiveWindow) and call theFlashWindowEx function to notify the user.
Is somebody can explain me what "while the user is working with another window" means exactly or where i can find it
|
|
|
|
|
Basically what it means is that from Win2K upwards, applications cannot steal focus from other applications. You can set the focus to any window in your app as long as the current focus is with one of the other windows in your app. But if the focus is on a window in a different app, then you cannot steal the focus.
I believe there is some undocumented registry setting to disable this prevent-steal-focus setting.
Regards
Nish
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
Which would be a VERY bad thing to change on users without their consent.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
First thank you for your quick response to my problem on "The Code Project".
What you say seems to me very logical, but I have also the case in a multithreaded application where SetForegroundWindow fails to give the focus to the good window. In fact it seems that no window has the focus until I click on a window.
Do you know a logical explanation about that or a place to find an explanation to this problem.
Regards
gwen
|
|
|
|
|
Perhaps in a larger program the size of a STL program becomes more the same as a program without STL, however, I'm am creating some example programs and have realized that the little 50 or so line example programs I'm writing are building up to 500k or more in debug and 100k or more in release.
I looked a little closer and saw that there are quite a few dependencies that must be the reason. Is there any way around this? Is this normal? Do you guys/gals find it not as big of a problem with larger programs as the templatized functions and containers make up for themselves?
Thanks for you input in advance,
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Debug code is ALWAYS really bug, don't worry about it.
In release mode, check your compiler optimisations. Default is optimise for execution speed, you can do a lot to bring the size down.
But the single biggest thing that affects your average windows program (maybe not STL though), is whether you statically link with MFC or dynamically link. dynamic linking is smaller, but your program has more dependancies.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Does anyone have a RELIABLE serial port class that uses messages for notification, etc. Thanks
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
Ramon de Klein's Serial library for C++ is very popluar here at CodeProject and meets your requirements.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|