|
See "Debugging in Release Mode section" of this artcile[^].
|
|
|
|
|
Hello Everyone,
I'm a newbie, Please help me!
I'm adopting the code that could redirect a console output into the MFC Edit box.
My problem is, i want to have a live redirection from the console output to the edit box because i have a console application that will run about 5-10 mins and produces lots of information (output) in between those time in the command line.
My recent code will just wait the application to finish up before it could redirect the output from the command line to the Edit box.
Please help!.... thank you very much..
-rupert-
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
Dear all,
i need to apply a set of changes to the project settings such as compiler options, linker options etc programatically. I found an MSDN article about automating MSDEV.
http://support.microsoft.com/kb/q247035/[^]
In the msdev automation interface there is a COM interface IConfiguration for each build configuration. I think by using that, we can update the project settings. But didn't find any useful information. Please help.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
This is rather general question wich entered my mind when i read an answer written by Christian Grauss to a question a little further down. He said that in C++ variables should not be declared until they are used. Why is that ? And why is that different in C ?
|
|
|
|
|
In C, you need to declare your variables at the top of your function (otherwise, you'll get a compilation error), which is quite messy (you have a bunch of declared variables that you don't know their purposes). In C++, you can declare your variables when you want in the function, so, it is better (IMO) to declare them only when you need them.
|
|
|
|
|
To add Cedric;
By declaring it at start, it will be in memory unnecessarily for longer time, when its required somewhere down in the code. So declare it when its necessary. And its always easy to track it in this case.
Mr.Brainley wrote: And why is that different in C ?
Its by standard in C.
|
|
|
|
|
If you create them at the top of a method and then at some point during the method you return without using the variable, then you have created it for no reason. This could be expensive if the creation takes a long time, or uses a lot of memory, or if the object has several base classes for example.
Typically you should only create a variable at the point you are going to use it, this an help the compiler perform its optimisations too.
It also makes the code easier to use and less prone to bugs as you cannot accidentally change the variable before first use if you create it only where you need it.
You can also control the scope of the variable so it only exists for as long as it needs to.
regards,
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
I guess I need to answer.
As has been said, in C, you have to do it at the top.
In C++, you don't, but some do, just because they learned from someone who does it that way, because they are used to it from C. Declaring the variable close to where you use it makes code more readable and less prone to bugs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I learnt C++ first, then had to "backport" myself down to C when I got a job where the lead programmer was afraid of this new fangled OOP stuff.
You wouldn't believe how long it took me to realise that you had to pre-declare all your variables - there was much confusion before that!
|
|
|
|
|
Mr.Brainley wrote: Why is that ?
In C, you had to declare variables before any staments. In C++, you can declare variables at the point in which they are needed.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
I am using VC++ 6.0 version. As a part of my project I had to use IHTMLInputElement Interface ( IHTMLInputElement *ptr ) . I added <mshtml.h> header file . But
Error is coming like this
"IHTMLInputElement' : undeclared identifier"
Why this is happening
|
|
|
|
|
I hop you have checked this,
Header and IDL files Mshtml.h, Mshtml.idl
Minimum availability Internet Explorer 5.0
|
|
|
|
|
|
Hello,
I am trying to examine MathType (Equations) OLE data.
My daughter Stav is totally blind. She is learning in the 10th grade and she needs books in Braille. I contacted the publisher of the Mathematics book she needs to learn from in order to produce it in Braille. I received a Word document containing embedded MathType equations.
This is a one time job, so if some of the steps should be done manually I do not care.
I finaly reached the conclusion that each equation data is kept in OLEDATA.MSO, MathType documents the binary data but I can not find it inside the file. Can someone help with the format of the file?
I saved the Word document as XML (Office 2003) and found all
//o:OLEObject[starts-with(@ProgID, 'Equation')]
But I do not know how to go from here
Thanks, Reuven
|
|
|
|
|
Hello!
I have a problem with push-like checkboxes in my app under WinXP. When I embed manifest my push-like checkboxes look cute (round corners etc). But when mouse moves over that button it is hilighted. When mouse clicks it is still hilighted so the user cannot see check state (is button pushed or not). User is able to see the actual check state only when mouse is moved off the button. So in the case of push-like checkboxes this fancy hilighting is bad.
I want to turn off hilighting when button is in checked state.
The only way to do it (as I can see at the moment) is to subclass button window class. But the problem is I don't know to which messages to pay attention and what to do to stop hilghting.
What can you suggest?
------------
I love you
|
|
|
|
|
How to declare checkbox and your problem is manifest ?
|
|
|
|
|
I'm not sure I can understand your question.
By the way, I have mentioned manifest just to emphasize the fact that my buttons have native WinXP look-and-feel, including that evil (in my case of push-like checkboxes) hilighting.
------------
I love you
|
|
|
|
|
Hello.
Im confused about const return types in functions.
To me it seems to say that the object that will be returned will be const, that is to say the object will not be modifiable. But I was messing around with it and I am able to modify the const return value .
Could someone please explain const function return values.
Thank you.
|
|
|
|
|
minkowski wrote: But I was messing around with it and I am able to modify the const return value .
Because you probably copied the return of the function into a local non-const variable. Something like this:
const int Fun()<br />
{<br />
return 10;<br />
}<br />
<br />
int main()<br />
{<br />
int Temp = Fun();<br />
Temp++;<br />
}
It is perfectly legal because you don't modify the return value of the function but you modify a copy of it (which is non-const).
|
|
|
|
|
Thank you. Also is the same true for user defined objects? And also for returned references?
Thanks again.
|
|
|
|
|
minkowski wrote: Also is the same true for user defined objects?
Yes, if you store it into another instance (the same way as in my previous example), you still make a copy of your object. And you can of course modify the copy without any problem (as it is constant).
minkowski wrote: And also for returned references?
A reference lets you return a member variable directly (for example in a function from a class, you return a reference to another member of your class). That lets you modify this variable directly. If you return a const reference, then you won't be able to modify the variable directly. Of course, you can still assign it into another variable (results in a copy of your member variable) that you can modify (it's a copy, so you can modify it, if it's non-const)
|
|
|
|
|
minkowski wrote: But I was messing around with it and I am able to modify the const return value
Thats because, you must have removed its constness by assigning it to non-const variable.
OOps ! already answered by Cedric.
Same old thing, need to refresh frequently.
|
|
|
|
|
Ok thanks guys. It makes sense now. I forgot about returning values makes a copy of the object (providing the return type is not a ptr or ref).
|
|
|
|
|
Hi
How to print bitmaps in VC++ ?
thanks
KK
|
|
|
|
|
One way is you can use of CreateDC or see StartDoc
|
|
|
|