|
Hi...I'm working with trigonometric functions in visual C++ V6.0.
I have this program that converts degrees to radians, applies some direct trigonometric functions, and then some inverse functions.
The inverse function I'm using is the ATAN2(y,x). I have checked the function and it uses the definition of pi=3.141592653589793116E00.
The examples given in the MSN documentation uses pi=3.1415926535 giving the correct results.
Then, I was using the last definition of pi to convert degrees to radians and viceversa, but using also the atan2(y,x) function, and I'm getting that:
cos(90. degrees)=-3.4914833611094e-15
Then, because the definition of pi is different in the conversion and the function, I have decided to make it uniform, as I cannot change the definition of pi in the atan2() function, I decided to change the definition of pi used for the conversions, however, I ave got the following:
cos(90. degrees)=-6.1230317691119e-017
Which is less than the previous result, but still is not correct.
Is there anyway to avoid this situation?
Thanks,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
emrosa wrote:
cos(90. degrees)=-3.4914833611094e-15
cos(90. degrees)=-6.1230317691119e-017
You should never expect to get exactly 0. Floating-point numbers and operations are not exact.
It seems to me that
-0.0000000000000034914833611094
and
-0.000000000000000061230317691119
are pretty close to 0.
|
|
|
|
|
Hello,
I am developing an application using RichEdit20a. I have designed custom fonts. Now whem I am using them in my application they looks simple. But when I display them in MSN (which contains RichEdit20a also) they become sharper and more visible.
Please anybody help me how could I do this in order to do the same as as MSN did.
The Phantom
|
|
|
|
|
How can I read the content of a messagebox through my VC application
Please reply asap
Thanks for ur help
Uday
|
|
|
|
|
I'm not sure what you mean. Do you want to read the contents of an edit field in a dialog?
|
|
|
|
|
No, static Text, Label
Say in MessageBox it comes as Hi! This is for Test
I want to read this
|
|
|
|
|
udayGovekar wrote:
...static Text...
Call GetWindowText() on the CStatic-variable, or call ::GetWindowText() with the HWND of your static text control.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I don't think there are functions to do it that if you use MessageBox. But why do you want to do it anyway? You provide the label and text for a messagebox yourself so there's no need to read it.
|
|
|
|
|
Number of ways...
e.g.
GetWindowText()
GetDlgItemText()
Have a look in MSDN for more info on both these.
If it's an MFC app dialog app and you have the Resource ID just use something like:
GetDlgItemText(IDC_STATIC, string);
where string in a CString reference, for example.
Regards,
Brian Dela
Run naked in the snow until you're sweating like a stuck pig and can't seem to catch your breath. When the flu becomes pneumonia, they can cure that with a shot. - Roger Wright
|
|
|
|
|
hi
I am using owner drawn menus from article written by Bret Corkum on code project itself. I have a question on that:
1. I am adding popup a menu runtime.
2. I am graying it out using MF_GRAYED option in EnableMenuItem but
whats happening is that the text of the menu and the bitmap gets grayed
but the arrow icon that acompanies a popup menu ( at the extreme right
hand side ) does not get grayed out.
|
|
|
|
|
Mihir Gore wrote:
but the arrow icon that acompanies a popup menu ( at the extreme right
hand side ) does not get grayed out.
This is a standard problem that lots of people have asked about. As far as I know, I have yet to hear of a way of fixing it. This is because your owner draw code doesn;t draw the arroe, windows does and there seems to be no known way to stop it doing it (yet).
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi
i've derived CMyListCtrl from CListCtrl.
everything works fine, i can edit subitems and so.
But i want to limit the total of characters typed in a subitem of column 1 & 2. But there may not be any restrictions in the other columns though.
Anyone knows how i can achieve this?
Thank you.
Jens
|
|
|
|
|
If you popuping up an edit control to allow th edit, you can just call LimitText (EN_LIMITTEXT) function to set the maximum number of characters which can be entered by the user for the columns you need to limit.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
yeah thanks, works great.
I've come up with the following problem:
Number | BirthDate
01 | 12/08/1980
How can i be sure that only numbers are typed into the number column and only dates (0-9 & "/") in birthdate column?
I'm afraid this gets more difficult
Greetings
Jens
|
|
|
|
|
Hey, i am using a dhtml IE5.5 control in my program in edit mode. it provides the Ctrl+X/Y supports for undo and redo. but i'd like to have standard buttons for undo and redo, so does anybody know how to do that?
thanx
And you will know my name is the Lord when I lay my vengeance upon thee.
|
|
|
|
|
Pop3.obj : error LNK2001: unresolved external symbol __imp__WSAEnumNetworkEvents@12
Pop3.obj : error LNK2001: unresolved external symbol __imp__WSAWaitForMultipleEvents@20
Pop3.obj : error LNK2001: unresolved external symbol __imp__WSACloseEvent@4
But the Winsock2.h and afxsock.h are included.
I'm trying to use the class incapsulating the work with sockets
|
|
|
|
|
Have you linked the ws2_32.lib in the project settings?
|
|
|
|
|
|
Hi
If i understand u right
Try to include in the project settings\Links\Objects/Library modules
Ws2_32.lib
I hope it works
Good Luck
|
|
|
|
|
I have a qustion about Visual Studio and WTL.
When I have installed Visual Studio .NET 2003 and I want to use WTL must I install something (Platform SDK, ...) or have I all?
|
|
|
|
|
How do I block the Windows-keys, Ctrl+Alt+Del, Alt+Tab ? I've seen that in Star Trek Armada and Star Trek Elite Force, and I wondered how that could be done. I've tried a keyboard hook, but I can still Alt+Tab out of my application, open the Task Manager or display the Start-Menu.
Thanks,
widi
-
|
|
|
|
|
Did you post three messages by misstake or are you trying to be bothersome?
Lookup SystemParametersInfo() in MSDN and look for a flag named SPI_SETSCREENSAVERACTIVE. It only works for Win 9x!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
it was by mistake, sorry.
Thanks
widi
-
|
|
|
|
|
Joerg Wiedenmann wrote:
it was by mistake, sorry.
It's okay!
have a look at my message again.. I've change some parts of it!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|