|
See if this article helps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
This is very helpful but where did u get the value of pDC from?
|
|
|
|
|
It's passed to the view's OnDraw() method.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I want to take the real part from a decimal number for example if i have 3,13 take only the 3. I remenber that there is something to do it but i dont remenber yet Thanks
|
|
|
|
|
#include <math.h>
int nFloor = (int)floor(3.13);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Try:
double d = 3.13;
int n = d;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Of course at this point you should have already realized that what you want is not the "real" part of a number but the integer...
someone suggested
double d = 3.13;
int n = d;
this will actually produce a warning regarding possible loss of data. Try instead
double d = 3.13;<br />
int n = int(d);
|
|
|
|
|
From MSDN:
double modf(
double x,
double *intptr
);
Splits a floating-point value into fractional and integer parts.
This function returns the signed fractional portion of x. There is no error return.
x : Floating-point value.
intptr : Pointer to stored integer portion.
The modf function breaks down the floating-point value x into fractional and integer parts, each of which has the same sign as x. The signed fractional portion of x is returned. The integer portion is stored as a floating-point value at intptr.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi
I am trying to develop a new CButton sub-class that has the following behaviour:
- when the user clicks and holds the button, and event is fired
- when the user releases the button, another, different event fires.
In other words, I want to know when they press (and hold) the button and I want to know when they release the button.
With CButton, I only get 1 event: a WM_COMMAND when the button is released.
Any help would be appreciated. Thanks.
Tim
|
|
|
|
|
See here and here for examples.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thanks very much for your quick reply. That should be enough information.
|
|
|
|
|
What is the difference between CSocket and WinSock.
Be FaithFull To Your Work.
|
|
|
|
|
42, of course.
(Smells like homework).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The latter is an API, while the former is a class that encapsulates this API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello All,
I have been working on a DLL (Regular DLL with MFC statically linked) that contains a CDialog that I would like to run as modeless. In order to reset the CWinApp's ref to the Dialog to NULL when the Dialog closes, I am trying to store a pointer to the CWinApp so that I can m_pApp->setMyDlgNull(). It seems as if this should work, but whenever I try to add the pointer into my CDialog class, the compiler acts like it does not know what my CDLLApp is. I am not sure what is going on as I have #included my CWinApp's header and I can get the popup with my setMyDlgNull() function when using CDLLApp:: (does not happen when i do not #include).
I am sure that I have made the most idiotic mistake so go easy on me
|
|
|
|
|
Can anyone tell me if MSDN .NET 2003 is available for download? I remember a 4 Gbyte DVD version was available a few months back, but I was hoping that I could get something that I can put on normal CDs because I do not have a DVD in my computer. I ran a few searches online but I cannot find anything. I am just wondering if it is available at all?
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
|
Thank you for the ingenious idea. Have you applied for the Nobel Prize recently in the area of critical thinking? If you haven’t please don’t let you ingenuity go to such a waste.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
He's right. It's only available for download to MSDN subscribers...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
He's right. It's only available for download to MSDN subscribers...
Thank you very much Ryan. That's an answer that I understand.
About the anonymous reply: He didn't really answer my question. I didn't ask for the nearest store. I asked whether I could download it. I already have it on a DVD and I can get the CDs for $3 here at the place where I work but it would take them several days to deliver the CDs to me. I need it today but it is clear that that's not going to happen .
Once again thank you.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
Toni78 wrote:
About the anonymous reply: He didn't really answer my question.
Agreed, but (no offence intended) you could possibly have phrased your answer a little more politely
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Agreed, but (no offence intended) you could possibly have phrased your answer a little more politely
None taken. Once again thank you.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
sorry about the formatting - i don't know how to make a table.
take these numbers...
Cost; Age; Cost * Age
x; 6;
8,025; 20; 160,500
346,950; 47; 16,306,650
279,252; 58; 16,196,616
387,640; 69.2; 26,824,688
84,500; 80; 6,760,000
Totals
1,106,367; 59.9; 66,248,454
the task is to find x which brings the total Age (59.9) down to 40. now, the total cost number (1,106,367) can not change. meaning, x must be subtracted out starting from the bottom. so, if x is 80,000, 84,500 is reduced to 4,500 and Cost * Age becomes 360,000. the idea is bring total Cost * Age down to 44,254,680 (1,106,467 * 40).
i just can not for the life of me figure out how to calculate x. can anyone help?
thanks.
|
|
|
|
|
How is the age total 59.9 when you have 6 + 20 + 27 + 58 + ...
How can you choose x to be anything but 0 if you want to total cost to remain the same?
I don't think your problem is well defined.
|
|
|
|
|
Homework alert. Homework alert. If this had been an actual programming question, you would see real live answers from actual programmers. This has been a service of the Emergency Programming Association.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|