April 2004 - Posts
If you are a good developer you know that you should layer your application, however, Visual Studio uses the "old Visual Basic" approach to rich client development. In other words, you create a windows form application. What does Visual Studio do, it creates a main function in the form you create first. Already that means the form is doing more than presentation. Potentially people will also write application initialisation code in this function. Ok I add a button to the form and click on it and the idea opens up the associated event routines. So far I could be writing all my business logic etc within the form.
Of course no one would do this ??? Well, how many prototypes that become production systems are written this way, it is seductive to less skilled developers.
Wouldn't it better if the tools tried to lead people to develop applications using a layed approach. It would certainly help with migration later on to Avalon.
I just saw this business week article being discused on slashdot and thought it illustrates that difficult decisions are starting to made around Longhorn. In other words what features are going to be in the product and which ones will be left out. This is good news as means it will possible to start looking again at the PDC stuff and deciding which bits are worth learning. The trouble about the article is that really does not tell you which bits are being dropped just some vague comments about WinFS.
Happy holidays to everyone, it is great to not have to work again till Tuesday.<br/><br/>
Update: Thanks Drew, it looks like I made the mistake of reading the Business Week article and assuming it was reporting news. It seems like another piece of FUD
I finally found out what my problem was with my code that ran ok on 2000 but throws an exception on Windows XP. I have this piece of code
Using the enablevisualstyles method XP visual styles are applied to your winforms when the application is running on Windows XP. Unfortunately there seems to be some bugs with enablevisualstyles. I got bitten by one of those bugs. My wizard control is displayed using ShowDialog() and this throws an exception on XP but none on Windows 2000. In order to solve the problem you must use the following code:
There seems to be some other bugs with
from Code Project
Jeff I wish had remembered your blog entry last year about this problem. It would be so nice if this problem could be fixed in a service pack as it is a real pain.
I have been developing a .Net rich client application in C# for internal company use. My machine is running Windows 2000 and I am using Visual Studio 2003 for development I decided to use wizard control from Tim Dawson
. I have created a form and placed the wizard control on the form. From the application I open the form containing the wizard using ShowDialog() and then close the form using this.close(). This works perfectly well on Windows 2000, but when I install the application on Windows XP, a CLR unexpected exception error occurs when you I try to close the wizard control form and I have to close the application. I changed the code to use this.dispose() but I still get the problem, again it works perfectly on Windows 2000 and fails with the same unexpected exception error on Windows XP.
I know the joke with Java is that it is a "Write Once test everywhere" solution. After this experience I am beginning to wonder if this is also true of .Net. I would expect there to be difference in behaviour between Windows 9x and Windows 2000/XP but I am surprised about there being a big difference between 2000 and XP.
I am curious if anyone can help me and explain the differences between the CLR exception handling on 2000 and XP , if there are any and areas where I should check. I have tried to google for for information but without much joy.