| Site Home |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
|
|
![]() ![]() ![]() |
| app |
Posted: September 02, 2006 11:31 am
|
||||
![]() Member ![]() ![]() Group: Admin Posts: 21 Member No.: 17 Joined: February 25, 2006 |
As someone that understands that there are some still using windows 95/98/ME, there is a need to make sure your code doesn't crash on these systems if you do something that will only work on a newer version of windows. If you were to add a feature that relied on a function only present in a newer version of user32.dll than is included with 9x, by using a code similar to this, your application would crash on 9x systems as soon as the program is run, despite the fact you have detected the OS and only used it in a function targeted at newer windows versions. This code is supposed to display the system idle time in a label on 2k & up while displaying the caption 'Idle counter disabled' on older systems. But that isn't exactly what happens when you compile this and run it on an older system. It crashes as soon as you run your program.
The problem is in how you are linking. In this example you have statically linked in the LastInput function. Windows 9x can't handle this because the function you need isn't present in it's copy of user32.dll. Done this way, even if you are not going to actually call your function on 9x, it will try to load it in preparation for you to do so any way...which will cause your program to immediately crash as soon as it is run. A better way would be to dynamically link it as shown in this example:
This will work as you want it to on both newer and older versions of windows. The newer versions will have the idle counter on the label and older will have a disabled message. So now you know how to support more OS's in your code. In my above example, I might go a step further and find a way to display the idle time on 9x too, by maybe using a global keyboard & mouse hook and measure the time since last input. Or if I wanted something to happen only when system is idle, detect if the screensaver is running. That way 9x systems can still have the same features, but in a different way. It is your responsibility to make sure your code works, rather than to blame the user for not running the OS version you feel like coding for. There is no reason to rate a person's worth as a human being based solely on the OS they run. It is wrong to blame the user for your laziness and sloppy coding. Detecting OS version and disabling unsupported features and/or doing things differently for some versions will become important not just for supporting 9x. Soon Vista will be released and it will be able to do things that 2k & XP can't and there will still be many running those versions that can't or won't upgrade to Vista. You will need to be able to support 2k & XP too. If you think you can get away with just coding for 1 windows version, you are a fool. Some other programmer will have their code on more systems for more people to enjoy than you because they took the time & effort and did things right. This could result in less money in your pocket and more in theirs. Why would you want to give away potential profit to your competition when with a bit more effort you could do things right and create a program that everyone can enjoy? -------------------- |
||||
| rkarman |
Posted: September 02, 2006 01:49 pm
|
|
Administrator ![]() ![]() ![]() Group: Admin Posts: 66 Member No.: 1 Joined: February 19, 2006 |
i don't agree to the claim that it's the developers responsebility (sorry april
bottom line is, if a group is traveling north, and 3 individuals refuse to walk, does the whole group stop advancing? no one is forcing anyone to walk, but don't start whining if you see everyone else walk past the horizon. but of course i'm not saying that there is no time to take a revival break from walking here though. so in this light you should of course not assume everyone to have windows visa within the first year or so after it is released. and yes there are even groups of people walking south (linux) or west (beos) or east (apple?). if we all try to keep the groups together, then no one gets anywhere. i think waving the responsibility of a user that they choose which group to walk with, or if they choose they are too tired to move on, is not realistic. on the other had waving away the responsebility of the developers to not start running so at least everyone who really wants to can keep up is also not good. now after all this, i have to say i like the article and the technique it explains. and of course if there is no real reason to not add backward compatibility, why not add it? |
| app |
Posted: September 12, 2006 04:32 am
|
![]() Member ![]() ![]() Group: Admin Posts: 21 Member No.: 17 Joined: February 25, 2006 |
It is the Windows developer's responsibility to make sure his application doesn't crash on versions of Windows he KNOWS it won't work on. It can be as simple as showing a message box that says 'Sorry, this won't work on your version of Windows'.
What I am most bugged by is arrogant lazy individual developers that play a blame game with users, implying that they are a worthless waste of human life because they don't run the version of Windows they choose to develop for and they are too lazy to figure out how to either support it or properly NOT support it. You don't blame the user for your laziness. It's wrong....morally wrong. When you know your program will crash on Win98, and you don't care enough to properly disable it from running on Win98, and a Win98 user runs your program and it crashes, I consider that a bug. Fix it, damnit, and don't blame the user for it, or call them nasty names. Like my IdleStart program that I made at the request of JeffK. I knew it wouldn't work on 9x, and there wasn't a way I could think of that would make it work on 9x...but I made sure it wouldn't crash if a 9x user tried to run it. And even if my program crashed on 9x and a user complained...I would be polite and apologize and fix it so it wouldn't crash...not be rude and nasty and call them names and say 'oh well' and not bother to fix it so it will properly exit if run on the wrong Windows version. It is the attitude that I have the problem with. And I am not talking about a big companies...I am talking about individuals. A big company wouldn't play the blame game I described with a customer...it would be bad business. Imagine if you bought a program and ran it on XP and it crashed...because it only will work on Vista. And you contact the company...and they tell you that you are a piece of shit for running XP...made rude comments about your mother...and demand that you upgrade to Vista. How likely would you be to ever buy another program from them, even after upgrading? And you'd tell your friends what happened, too. They would lose so much money from treating you that way. That's why big companies are not the problem...they wouldn't say that to you. It's the single freeware developers that are much more likely to act this way...the ones I think have a screw loose somewhere. They just don't get it. And there are many that are here on this forum just learning. My post and remarks are for them...a warning not to become an arrogant irresponsible rude programmer. A warning not to make excuses to justify acting that way. I am tired of the rudeness and excuses. My post was made with the intent to get rid of the excuses....the ones that students make when they static link and their program crashes. Now that they know how, what excuse are they going to use if they decide to be lazy...and rude? Of course, you being a nice guy & all, this wouldn't apply to you and I can see how you might disagree with me. But think of people like Bender and KM. Now you'll understand why I said what I said. We don't need more programmers like them in the world...do we? -------------------- |
| tseng |
Posted: September 26, 2006 01:18 pm
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 79 Joined: September 02, 2006 |
Windows versions lower than 2000 are no longer being supported anyway, so people should be and will be moving away from the now anyway.
|
| app |
Posted: September 26, 2006 05:37 pm
|
![]() Member ![]() ![]() Group: Admin Posts: 21 Member No.: 17 Joined: February 25, 2006 |
No longer supported? By who? Microsoft?
I am glad they can tell me what OS I can code for and what software of mine I can support or not. Should be and will be moving away now? You know some big secret that the rest of us don't about how to get really old computers to work with newer OS's? You know the Driver Fairy? Send her my way if you do because I don't run 9x on my other pc totally by choice. And you have some inside information about a big PC giveaway for the elderly, disabled, children, low income families, etc that are on fixed incomes or low budgets? Where is the money going to come from for a new PC that will support a newer OS? Do you really think that just because they can't afford a new PC that they don't deserve software that works? That somehow they are less than human? Should they choose to buy a new PC instead of paying their rent? It's good to be homeless with a brand new PC, right? Or should they just give up eating and starve to death just so they can have a new PC? That would be good too, right? It's businesses that will upgrade (and they should)...it's a lot of ordinary people that can't/won't for a variety of reasons. And how long is Microsoft going to support Win2k? A few more months? Support for XP is supposed to end 2 years after the release of Vista. And I heard Vista is going to be a $400 upgrade. If you think everyone is going to pay that and upgrade, you are nuts. And for many that would require new hardware too. There will be plenty sticking with their current OS and hardware. I am already seeing software projects dying because of vista. One program in particular that won't work with vista and they can't get it to work. So it went freeware and all development on it is halted....dead project now. I am sure there will be other projects that there will have to be 2 versions, or they will have to do things differently to get it to work on both XP & Vista. And that is what my original post was about. This isn't just a 9x issue. Learn OS detection and dynamic linking...learn it well...you will need it when we don't all upgrade to Vista...or the next OS after. -------------------- |
| tseng |
Posted: September 28, 2006 06:55 pm
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 79 Joined: September 02, 2006 |
It can be seen this way as well, if you don't want to upgrade, why should someone add extra function to their program just to support you.
As for upgrading to Vista, most will buy a whole new computer, which will have better specifications, and it will include a copy of Vista. I will only code my software for 2000 and above, because I know the Win32 API I will use is still supported. I won't display a message saying you're OS is not supported, nor will I claim my software works on operating systems which are lower than 2000. I will only claim it works on 2000 or above, and anything else is a bonus. I also have to agree with multi when he talks about advancing. You can't keep developing for the older operating systems just because people are still using them. I like the games console example, people may still own the older consoles and games, but the manufacturers are going to spend money on developing newer consoles and games, rather than keep supporting the older games and consoles. |
| app |
Posted: October 13, 2006 05:25 pm
|
![]() Member ![]() ![]() Group: Admin Posts: 21 Member No.: 17 Joined: February 25, 2006 |
You are missing the whole point!
This isn't about 9x! The only reason why I used 9x as an example was because that was the situation I ran into in my own personal experiences. This is about keeping up with the latest & greatest while not abandoning people that choose not to upgrade to the latest & greatest. Vista is the next big issue...not 9x! If you are going to support Win2k or XP and still take advantage of what Vista has to offer, then you are exactly who my target audience is. You can't do that by just shoving in code that will work on Vista and not care if your application screws up on Win2k or XP....especially if you know it won't work. And what is the alternative? Code and maintain 2 versions? Isn't that a waste of time, effort, and money? Why not just do it right to begin with in the one version? Are you going to bash 2k & XP users when they don't upgrade? Are you going to tell them that your application crashes because they are stupid idiots? Look at this example and tell me if I am wrong: You are a single developer that writes shareware or donationware applications. You are running your own small company. You have no employees except yourself. You have to compete with freeware & open source to earn a living. Every user counts. It is 1999. You have coded an application that runs well on Windows 95 & 98. Windows ME and 2k are soon to be released. You decide that you want to add a feature that will work on 2k but not on the new WinME, or the older 95 & 98. So you change the way you add it, detect the OS, and enable it for users of those operating systems that are 2k and higher. It works on all versions of Windows...95, 98, ME, and 2k. Nothing is crashing, everyone is happy, you are making money from users of all 4 OS's. Now it is 2002 and XP is released. You want to add another feature but it won't work in 2k or 9x. So you add it, detect OS, and only enable it for people running XP or higher. It works on all versions of Windows...95, 98, ME, 2k, and XP. Nothing is crashing, everyone is happy, you are making money from users of all 5 OS's. Now it is 2007. Vista is released. You want to add more features that will only work in Vista and higher. So you detect OS, like you did before , and only enable it for Vista and higher. It works on all versions of Windows...95, 98, ME, 2k, XP, and Vista. Nothing is crashing, everyone is happy, you are making money from users of all 6 OS's. You have established a good reputation as not only being a producer of quality software, but for caring about your users, as well. You write a few more applications, keeping your customers' needs in mind...even the few 9x users. All your old loyal customers that have been using your software for many years trust you and buy them and recommend your stuff to their friends and family who become new customers. What's the alternative? Just add what code you please, don't bother with disabling it for OS's that you know it won't work with, and tell people that run the previous version of windows that they are idiots and that their mother does unmentionable things with donkeys, and it's all their fault when your program crashes the first time they run it? (Yes, there are programmers that think and behave this way.) When they finally do upgrade, do you think they are going to want to use your software after you insulted them like that? My guess is if you do that, you will be wasting your time, effort, and money and your nasty insulting attitude will have lost you many customers and you will end up bankrupt and exhausted and have no friends. (ok, I might be wrong about the no friends part...misery loves company and birds of a feather flock together...so you should have plenty of other bankrupt jerks to hang out with.) And as for upgrading to Vista, I just got a new PC less than 1 year ago and it didn't come with Vista or a coupon for a free/reduced price upgrade. I have no plans on buying another or paying $400 just to run your software when I can use someone else's software that was coded properly and will work on XP too. Maybe I come from a different world than you do where people matter more. A world where people still use 9x and have no choices about upgrading. A world where there are older people that don't feel comfortable with trying to learn a new OS. Disabled people that are living on a $600 check from the government and can't afford a new PC. Kids that are using the old PC's and not allowed to touch the new one. People living paycheck to paycheck and can only afford about $25 per year on software, if they are lucky. People that wouldn't even own a computer if someone didn't give them their old one or if they didn't buy it second hand and cheap. Students that are already up to their eyeballs in debt from the high cost of an education. They won't be upgrading to Vista. They will be sticking with what they have, what they know, what they trust. These are real people and they matter to me...I care about them...that's who I code for. I don't work for some big software company. I don't work for some big corporation coding stuff for their own internal use. I make little tools for little people....people like me. And they appreciate it...and they show their appreciation with their wallets and their praise and recommending my software to others. Those little people make it all worthwhile. And that makes me feel good inside. I won't abandon them or ever put them down. If I did I would be putting myself down too. I will not forget who I am, where I came from...and I will not put myself above my users as if I was somehow better than them. You go ahead and do that, if you want. I'll be here to code for your users when you abandon them. And I'll be happy to do it. And happy to put their money in my bank account. It's no less green than any body else's. As a matter of fact I think 'Gratitude Green' is the prettiest shade of green there is. -------------------- |
![]() |
![]() ![]() ![]() |