
Back to Blog index.
Finally, some installation codes and SLIP files from CodeGear. The new web-based installer is very small, only 5 megabytes, and depending on your Delphi version (serial number) and selections, it downloads only the needed installation packages.
With Delphi 2007's MSBuild based compilation, there's a new XML based project file with the .DPROJ extension. When you type MSBuild on the command line (and have the proper paths set up), you could compile your projects from the command line. I've yet to test this myself, though.
It's a pleasure to see what wikis can do. It has been probably one or two years since I last visited C# Online, but since then, the site has grown rapidly. For example, now there are many small, but much-needed (for beginning .NET developers, at least) code snippets that help you get started with Base Class Library (BCL) programming. So of MSDN doesn't cut it, try C# Online. I'd love to see the MSDN C# FAQ page to grow to similar lenghts, I'll have to check what's doable.
Time flies, they say. One of the proofs is that Visual Studio, Microsoft's venerable development tool, turns ten (10) already this year. Both eWeek and Microsoft mention this milestone on their web publications.
The only question that remains is: where's the birthday cake? :-)
Well well, shopping time again for Microsoft. Yesterday, Microsoft announced that it had acquired devBiz Business Solutions, the makers of TeamPlain Web Access, an extension to Visual Studio Team Foundation Server (TFS). Now, in addition to simply acquiring the company, Microsoft has made the product available for free for every TFS user! So, if you wnated to have a good web interface to your Team System projects, TeamPlain is the way to go, starting today.
CodeGear's Delphi 2007 is here (I'm still waiting for my copy, though) and I noticed from CodeGear's blog that there's a new "secret" registry key that you can set to remove the "Source has been modified. Rebuild?" prompt when a file in the project had been modified outside Delphi. The registry key is:
HKEY_CURRENT_USER\Software\Borland\BDS\5.0\ Debugging\PromptToRebuildDuringDebugging
Set this key's value to zero (0) to disable the prompt. Can make your life easier!
Sometimes, you will want to call a web service from C# code, but the web server's HTTPS (SSL) certificate is invalid or gives errors because it is not fully validated by a certificate authority (CA) such as VeriSign. For instance, this certificate could be a custom certificate to you've created yourself for testing purposes.
However, when you call such a web service from .NET code, the call will fail with an exception because of the invalid certificate. But as you could guess, there's a piece of code that you can do to trust the certificate nonetheless and work around the issue. The ServicePointManager class in the System.Net namespace contains a property named RemoteCertificateValidationCallback to which you can assign your custom event handler. Here's an example with .NET 2.0:
private void SetupCertificates()
{
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
new System.Net.Security.RemoteCertificateValidationCallback(
MyCertificateErrorHandler);
}
private bool MyCertificateErrorHandler(
object sender,
System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
// do testing here
...
// yes, we trust this certificate
return true;
}
The event handler (delegate) must be of the type RemoteCertificateValidationCallback from System.Net.Security. Of course, you can make the code cleaner with these three using statements:
using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates;
The asp.netPRO e-magazine has a good article for web developers using C#, or actually any .NET language like Delphi for that matter. Titled "Layering ASP.NET Application Code" it talks just about that: how you should architect your web applications for optimum maintanability, code re-use and performance. Recommended reading.
PS. Microsoft DevDays in Helsinki tomorrow, can't wait. :-) See you there!
If you have an ASP.NET web service that requires authentication credentials, you need a way to supply these in your client application. It can be difficult to find an easy answer from the .NET SDK documentation, so I'm giving a basic example here.
Shortly put, you need to use the NetworkCredential class from the System.Net namespace to supply the credentials. Additionally, you can use a class called CredentialCache to store an URL/credentials pair which your web service interface can consume. If you have a web service interface named "MWS" (for My Web Service), you can setup the credentials for Basic of Digest authentication, along with a timeout (always a good idea) with the following code:
private static void SetupWebServiceCall(
My_Web_Service_Interface mws)
{
NetworkCredential cred = new NetworkCredential(
"username", "password", "domain");
CredentialCache cache = new CredentialCache();
cache.Add(new Uri(mws.Url), "Basic", cred);
mws.Credentials = cache;
mws.Timeout = 15*1000; // 15 seconds
}
If you call this setup method before doing anything else with the SOAP interface, you get the properly set up authentication plus control over the timeout period. Of course, you would store the username and password somewhere for security instead of in the source code, but you'll get the idea.
AJAX is all the hype these days, but if you are new to the concept, it can be sometimes difficult to get a down-to-Earth introduction to the implementation details. Sure, MSDN has plenty of material available about ASP.NET AJAX 1.0, but there's also a good article at the C# Corner, titled "Getting Started with AJAX 1.0". Although a bit on the short side, it shows what most of the beginners need.
I just learned today that CodeGear's latest version of Delphi, Delphi 2007 for Win32 has gone gold, that is, the product has now been released to manufacturing (RTM). I should probably get my own copy next week, after which I'm going to immediately test how the new Vista features work. Good work, CodeGear!
Microsoft has just two days ago announced the availability of Windows Server 2003 Service Pack 2. From the Download Center you may download the installation packages for both x86 and x64, but also the full ISO images for the installation medias. That's something new I've not seen done previously with service packs.
There's also a Knowledge Base (KB) article 914962 that lists all the fixes and updates that go into this service pack. If you are running web applications with IIS 6, there seem to be many patches in the SP. So download your copy today.
As a software kind of guy, I tend to think processors are something that just run your code, but with today's pace of technology leaps inside processors (think multi-core, for instance) it is hard to ignore these achievements. For example, I must say I'm pretty impressed with Intel's latest server processor announcement: the Xeon processor 5300 series. This is a quad-core beast, but with about 50% less of energy consumption than previous models. I wouldn't mind seeing processor and PC technology to get even greener than it is currently. I read somewhere that the new Xeon 5300 chips wouldn't run 64-bit code, but I find that somewhat hard to believe. Let me know if you know the answer.
Well, those IDM guys keep on working busy. I just noticed that they had announced UltraEdit 13.00 only last week; it wasn't long when version 12 was announced. Good going! This also mean another update for myself, as I do enjoy using UltraEdit. The new version seems to bring in goodies like scripting support, web page browser preview and MSI install support. The quite annouying Internet Explorer (IE) View Source editor setting is also now customizable.
I'm a fan of tabbed browsing, and in my opinion Internet Explorer 7 does it better than, say, Firefox. However, there seems to be a flaw in IE that makes it often crash whenever you have closed it with many open tabs, and then have chosen the option "Open these the next time I use Internet Explorer". For example, just last time I missed several good MSDN articles because when I the again started IE to load the pages I had opened the previous day, IE died. And if you restart IE after a crash, only the home page(s) is/are shown. Now, I of course wanted to know where IE stores the list of previously open tabs, and noticed with Process Monitor (RegMon successor) that the registry key is:
HKEY_CURRENT_USER\Software\Microsoft\ Internet Explorer\TabbedBrowsing\LastSessionPages
Now, it wouldn't take much C# code to write an utility that saves the contents of this key, and then reloads the key on request. I'll see if I have the time to write such a utility.
As you know, Windows Vista takes a more stringent approach in security, and this will also affect application you develop. Many especially consumer-oriented applications have the (bad, in my opinion) to configure themselves to automatically start while Windows loads. Now, if those applications also need true administrative rights (because of older coding habits), Vista will block them from starting.
According to a recent Microsoft document, somewhat oddly available at Microsoft Downloads instead of MSDN, the locations (folders and registry keys) that in Vista simply block out auto-starting programs that require admin rights are:
Now, if your application relies on these locations to automatically start, consider a) changing your application not to always require admin rights, or b) convert your application to a service application. And if I may, there's my personal c): don't use the per-user registry keys, but instead use the Startup folder. This way, your user can actually see all those applications that automatically start, *and* s/he is able to control them. Not all users are able to use RegEdit or know about tools such as AutoRuns.
The Finnish Tietokone magazine has published my Windows Vista power user tips article. The article, "Windows Vista tehokäyttöön" lists eight tips that I find will make you a better Vista user.
Enjoy!
My company today had a Delphi 2007/Delphi for PHP launch event here in Helsinki, and it was fun and informative to attend it. Once the final RTM version of Delphi 2007 release is on my hands, I can't wait to test all the new Windows Vista stuff that's out there, for example the new components/classes to use the new, very versatile task dialogs. Also, CodeGear techie FH told us how the TApplication/main form implementation has changed to better support Vista. I'd be happy to compare Delphi 2006 and Delphi 2007 VCL source files to see what the real differences are. Although the documentation has improved dramatically in this release, I doubt these things are documented. :-)
eWeek reports that Microsoft has just announced an update to Visual Studio 2005 that makes it better compatible with Windows Vista. Officially, the new update is called "Visual Studio 2005 Service Pack 1 Update", which means that it is an add-on to the already-release SP1. The new update can be found from Microsoft Downloads.
If you have been following the CodeGear/Delphi world closely, you haven't missed the new Delphi 2007 for Win32 and it's new database support with DBExpress 4, or DBX 4 (DBX4) for short. A Delphi team member, Andreano Lanusse, has a nice blog post about the class hierarchies in the new database access layer.
Yeah, no developer content today, but interesting to all digital photographers nonetheless. I've now been using Lightroom quite extensively for the last two weeks, and I must say it is pretty impressive for a 1.0 product. Especially happy I'm about the keyword/tagging functions, because I believe those features will get more and more important in the coming years as the number of photos accumulate on my hard disk and DVDs. Looks like I need to "believe in black".
Before I forget, I found an interesting story about the development of Lightroom, or the codename "Shadowland". Earlier, I said that Lightroom immediately had that "Macromedia/Dreamweaver" feeling, but in fact it had a "ImageStyler" feel. ImageStyler was a nice graphics product that was easy to use even for a developer like me. Now it turns out that the same guys and gals that were behind ImageStyler, did the initial coding for Lightroom. Cool!
Whoa, so much to blog about today. It was my pleasure to attend Microsoft's TechNet Pro event at the Finlandia Hall here in Helsinki. Although not a developer event per se, it's a very informative event to visit. The session recording are all available at the ITpro.fi web site, which I suggest that you visit in case you already haven't.
Microsoft's Somasegar today announced the availability of the Visual Studio "Orcas" March CTP (Community Technology Preview). This CTP version can now be downloaded from Microsoft's Download Center. Can't wait to get my hands on this release, though I confess it might take few days before I have the time to do so.
Happy March everyone! I'm happy that the first official spring month is here. Sometimes, a great developer article can have no code listings at all, and still be pragmatic. One example of such an article is a recent MSDN article by Ted Neward, titled "Pragmatic Architecture: User Interface".
This article talks about designing (or rather, architecting) user interfaces, and the five fundamentals according to Ted. For example, should all your applications have a graphical user interface. Not necessarily! Read the article to understand why.
› Blog Archive