|
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
|
|
|
|
|
pnpvivek@gmail.com wrote: i put 1550 in time text box
answer 0.545161 is shown on frequency text box
My math says that should have been 1 / 1550 * 1000, or 0.645161.
pnpvivek@gmail.com wrote: 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.
Have you tried using %.0f instead of just %f ?
"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
|
|
|
|
|
You are late :P
--[^]
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
|
|
|
|
|
BTW
I sometimes have problems with delayment on the site an post a message more than once. Just making a reload of the forum and deleting the multiple messages does not take a lot of time, and would be nice from you.
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
|
|
|
|
|
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
|
|
|
|
|
HAI,
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 textbox
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
|
|
|
|
|
Please delete your two other messages.
This is not an error, it is due to floating point precision. Just don't print the decimals you don't need in the text box.
|
|
|
|
|
use trunc to quit decimals without rounding, or floor to round always down.
Is something annoying, I had it as well and didn't find a way to do it but this one.
BTW:
1 / 1550 * 1000 = 0,64516129032258064516129032258065 and not 0,54516
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
|
|
|
|
|
hi all
I use vs6
I have to find a way to change the default language of WinXP/Win2K
I can get the default language by use function GetSystemDefaultLCID.
if the return val of GetSystemDefaultLCID != 1037
i have to change it to 1037.
Is some one know the way.
TNX
|
|
|
|
|
This seems to be interesting. Have you achieved this? I could not find a solution immediately.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|