|
Maximilien wrote: it could be used for some debugging tracing purpose.
The same way as surrounding double quotes can.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Sure, but the nice thing about it is you can write a single macro that takes one argument
(a variable) and uses both its name and its value, making it easy to dump a lot of variables.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: a single macro that takes one argument
(a variable) and uses both its name and its value .
Of course, the above is the trick that makes the difference.
I hope the OP will realize it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
It seems some body didnt like your answer and you got 1 but I give you 5 because your time that you spent.;)
|
|
|
|
|
you're such a good guy hamid
keep it up
|
|
|
|
|
Hadi Dayvary wrote: How to get a variable name?
I forgot the macro!
The macro is: ABRACADABRA
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Can we use of this macro for other problems like find out exceptions on programs?;)
|
|
|
|
|
Sure!
I use it even to find a parking space for my car in the evening.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: I use it even to find a parking space for my car in the evening.
|
|
|
|
|
hi,
how to get the print preview option in a dialog?
thanks
panthal
|
|
|
|
|
Take a look in http://www.codeproject.com/printing/[^] section here and read a bit. There is a lot of things that can answer you.
Is not for a dialog but I recommend you the articles of Roger Allen and Joseph M. Newcomer their artcles helped me a lot while doing my own printing.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
|
have used edit control in dialog box.
I can get the entered string as
CEdit *ptrEdit = (CEdit*)GetDlgItem(IDC_EDITURL);
CString urlString;
ptrEdit->GetWindowText(urlString);
bool bDestination = PCHSEManagerInternal.IsDestinationReachable(urlEdit);
//above line is in MSDN
I do not know what is "PCHSEManagerInternal".
The following errors occured
error C2065: 'PCHSEManagerInternal' : undeclared identifier
error C2228: left of '.IsDestinationReachable' must have class/struct/union type
do I need to include any header file for this
please help me for this.
|
|
|
|
|
If you are using a MSDN example without taking care about what you are copying, it is totally logical that you have errors.
That "PCHSEManagerInternal" is a class that is being used in the example and, logically, if you didn't include the header that need that class your compiler complains at it makes. It can not know what it is, is the same scenario as if you create a class "CMyClass" and the you include "CMClass" the compiler won't recoginise it.
So...
Go another time to the web where you get that line, and READ the explanations and the whole code. Take special atention to the #includes and what the article/example say about that class. You may have to search for the whole class (*.cpp and *.h) when it is not an included component in VS headers
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Did you see Requirements of IsDestinationReachable?
|
|
|
|
|
I have used edit control in dialog box.
I can get the entered string as
CEdit *ptrEdit = (CEdit*)GetDlgItem(IDC_EDITURL);
CString urlString;
ptrEdit->GetWindowText(urlString);
This 'urlString' contains web site address e.g. "http://www.google.com"
I want to validate this web site address. i.e. give me code which validates such string.
please help me for this.
Chetan
|
|
|
|
|
CJ942002 wrote: I want to validate this web site address.
What do you mean by "validate?" Are you wanting to know if it's a well-formed URL, or if the URL actualy works? If the latter, try IsDestinationReachable().
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi
Whats the Difference between ASSERT and VERIFY macro?
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
They hide that information in the documentation.
From the description of ASSERT:
In the Release version of MFC, ASSERT does not evaluate the expression and thus will not interrupt the program. If the expression must be evaluated regardless of environment, use the VERIFY macro in place of ASSERT.
Judy
|
|
|
|
|
JudyL_FL wrote: They hide that information in the documentation.
So we are lucky that you have access to their documents.;)
|
|
|
|
|
The easiest way to find this out is by hovering over one of those words in the IDE and pressing the F12 key. That will take you to the actual macro where you can see what it does.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
HI,
I was developed the source code for time and frequency calculation.
i put two text boxes one for time value another for frequency value.
Both are float data type.
formula is :- frequency = 1 / time * 1000
and also Time =1 / frequency * 1000;
In Time text box kill focus event this( frequency = 1 / time * 1000 ) formula work properly and show one answer in float value in frequency text box.
but
In frequency text box kill focus event (Time =1 / frequency * 1000) formula did not work properly.
ex:
i put 1550 in time text box
answer 0.545161 is shown on frequency text box
then i move the cursor in to reverse ie, time text box it display 1550.000732 instead of 1550.
any body solve my problem as quick as early.
Thanking you.
vivek
|
|
|
|
|
Hi,
The way floats/doubles are stored in binary makes it impossible to exactly represent
most values, especially the ones that seem like round numbers to humans thinking
using base ten.
So 4, 2, 1, 0.5, 3.5, 3.75 and many others are representable exactly (basically since
they all equal an integer divided by some power of 2); but 3.6 and 3.8 and an infinite
number of other values are not.
Now whatever float/double function you call, if it returns a float/double will suffer
from the same phenomenon. So the only way to really get "3.6" or "3.8" is by using a
function that not only rounds but returns a string. I trust there are some formatting
methods that do just that in every programming language; In .NET languages
ToString() should be one of them, given an appropriate format specifier.
BTW: to circumvent this problem, especially for monetary numbers, they introduced
the "decimal" data type (which basically stores decimal digits).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|