|
|
Certifications are a joke, they are a waste of time. They prove nothing, apart from a willingness to pay for a test over and over, until you pass it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Certifications are a joke
And Microsoft is Big. So Microsoft Certified means a Big Joke?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Yep, probably
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
All the certificate shows is that you know how to take and pass a test. It doesn't show you are good at what you do. The chances are you will never be asked for it.
I'm a certified teacher. I spent years and a lot of money to get my certificate. Does that make me a good teacher? Does it prove I can handle rugrats nibbling away at my ankles? I think not. I have never EVER been asked for my qualifications, the only thing I do get asked for is my experience.
|
|
|
|
|
Hi,
The test case 30(“Verify the application is Restart Manager Aware”) for Certified for Vista tells "The application should shut down quietly via the RMShutdown API".
It's means I've to handle WM_QUERYENDSESSION in my application and respond TRUE back to OS.
The application should be in on idle. My application is MFC MDI application.
- The question is : where(CMainFrame or in MyApp::OnIdle()) and how(I've to return TRUE back) should I handle this.
Thanks for the any sutable information.
|
|
|
|
|
oleg63 wrote: It's means I've to handle WM_QUERYENDSESSION in my application and respond TRUE back to OS.
TRUE is the default return value. Unless your application needs to return FALSE , you don't need to do anything.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This has been a problem of mine for years.
It appears to be compiler specific which is why I put it in this section.
Run this piece of code
double test = 3.0/10.0;
The result of test is .299999999999999
I know why this happens. I was just wondering how some of you have solved this problem.
Thanks for any input
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: I know why this happens. I was just wondering how some of you have solved this problem.
If you know why it happens, then you must also know it has no solution. Floating-point numbers behave that way on binary machines.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Of course but when you are dealing with high precision numbers, you have to implement workarounds to solve the problem.
I was just wondering how others have handled it. You simply cannot leave it like that when dealing with mathematical engines written in c++. The error will carry through and get worse. So I just wanted to see what others are doing.
For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
Perhaps it makes use of some sort of epsilon value. See here for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
IGeorgeI wrote: For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
First, this isn't a C# forum.
Second, If you're doing this in C++, you're going to have to write some code to "fix" it. Write yourself a rounding function that will round to the nearest whole number. It ain't rocket science.
Third, you're arguing with someone that's trying to help you. Not very smart, even for a C# programmer.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am not a C# programmer by trade. I am a C/C++/Java/MFC developer.
1) I posted my C++ question in the C++ section of this forum. I merely added the fact about the C# compiler to help other people. You must have misunderstood my post.
2)I have written work arounds for this problem, I just wanted to see how other people have handled this problem out of pure interest. We can all become better programmers if we want to. You must have misunderstood my post.
3) At no point was I arguing with him. Why would I argue with somebody who is clearly trying to help me?? You must have misunderstood my post.
I would suggest that in the future you should try reading the post more closely to avoid misunderstandings like this. If you want, you can contact me anytime and I will help you with that.
Kindest Regards
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: I was just wondering how some of you have solved this problem.
add a tiny amount to the result of the division, then truncate. aka. 'round up'
yes, it biases the results in one direction, but them's the breaks.
|
|
|
|
|
First of all I want to state that I have read the other posts and would have ignored that one about C#. This is not a compiler specific problem, it is a hardware problem and I do not know any solution. Although there is an excellent book called “Numerical Recipes in …” (very old now) that probably addresses these issues. If Microsoft has introduced a way to solve it, via software, they have not been vocal about it. The only thing I can think of is rounding up when you see all those ‘9’s’.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
When I try to set the tab stops in a CEdit control using the SetTabStops(int numberofstops, LPINT tabstops) method, they don't get set properly and they appear different on two different Win XP-Pro computers. I set them to 64, 64, 64, 32, 32, 32, 32 and on one computer get the first one at 64, and the rest at 32. The other gives me the first at 64 and the remaining ones packed together.
Any ideas on what I'm doing wrong?
|
|
|
|
|
Bill Brocklebank wrote: ...they appear different on two different Win XP-Pro computers.
Nothing wrong with that since DLUs are machine, or rather, current system font, dependent.
That aside, wouldn't you need to use 64, 128, 192, 224, 256, 288, and 320?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: That aside, wouldn't you need to use 64, 128, 192, 224, 256, 288, and 320?
Actually, according to the MFC documentation, each value represents an offset from the preceding position.
int tabs[3] = {8, 8, 8};
Results in tab positions of 8, 16, 24.
I am still thinking about the unexpected format displaying problem.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Thanks. David is right. The documentation is ambiguous and I was interpreting it like John. Works fine now on the laptop I brought home. Should also work back at the office Monday.
Still doesn't explain the differences in the displays. It must be related to the display size (laptop is 1024x768 - it was packing down the data, desktop at work is 1200x900). But if they both work now, I'm happy.
Thanks again.
|
|
|
|
|
John R. Shaw wrote: Actually, according to the MFC documentation, each value represents an offset from the preceding position.
Did you get that from here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
David,
I made a mistake; I agreed with you and then ask MFC help to check in case I was wrong. I did not realize that it was giving me the description of StringFormat::SetTabStops instead of CEditView::SetTabStops.
“Each tab-stop offset in the tabStops array, except the first one, is relative to the previous one. The first tab-stop offset is relative to the initial offset position specified by firstTabOffset. For example, if the initial offset position is 8 and the first tab-stop offset is 50, then the first tab stop is at position 58. If the initial offset position is zero, then the first tab-stop offset is relative to position 0, the string origin.”
Oh well, that is what happens when you get out of practice.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi,
I need to know how to draw the checkbox button text background transparent.
Thanks
|
|
|
|
|
You could try the usual tricks - the WS_EX_TRANSPARENT flag, handling WM_ERASEBKGND, etc.
but I suspect they won't work on checkboxes.
You can always render the text yourself
|
|
|
|
|
Hi,
I have tried to handle WM_ERASEBKGND and I have also set WS_EX_TRANSPARENT for my CButton derived control, but the background still is not transparent.
How can I render the text only? I don't want to draw the box and the checkmark myself.
Thanks
|
|
|
|
|
Yeah... most, if not all, of the standard controls use opaque background on their text.
You can draw it yourself using something like DrawText(). Obtain the checkbox rect in
OnInitDialog() and set the controls text to an empty string (you could get the text first so you
have the text string). In OnPaint(), call the base class OnPaint() then get a DC for the window
and select a pen of the text color into it, set its background mode to transparent, and use
DrawText() to render the string.
The Microsoft recommended method is owner draw.
Mark
|
|
|
|