Steve Trefethen Archive

My blog posts have moved

In case you were looking for blog entries I’ve written they’ve moved to my new blog. You can use either the complete archive link or the search box in the upper righthand corner of my site to find old entries. This is my final post here on the Borland blog server as all new content will be on the new site.

Posted by Steve Trefethen archive on November 20th, 2006 under Personal | Comment now »


This blog has moved

To gain some added flexibility I’ve decided to move my blog, here are the details:

Please update your bookmarks/feeds to point to these new URLs. Unfortunately, this version of .Text doesn’t provide an easy mechanism to perform an HTTP 301 Permanently moved otherwise you wouldn’t have to read this post at all. And yes, I’m still a member of the Delphi (BDS) development team so none of that’s changed. In the next few days I’ll be redirecting traffic to the new site.

See you on http://www.stevetrefethen.com/blog/

Update: Due to *huge* amounts of spam coming in from this blog server I’ve disabled all comments. Unfortunately, that means you won’t even be able to read any existing comments but my inbox can only take so much. And yes, in case you’re wondering these are a few more reasons as to why I’ve moved my blog.

Update #2 Nov 19 2006: I’ve moved all of the posts from this blog to my new blog.

Posted by Steve Trefethen archive on October 10th, 2006 under General, Personal | Comment now »


IIS or ADSI do not appear to be properly installed

The title of this post is an error message that can occur if you are using Delphi 8.0 and trying to create an ASP.NET application using IIS as the target server. I wrote this error message and for that I apologize, as it’s a terrible message. The error typically occurs when the IDE is unable to utilize ASDI (an IIS API) to create a virtual directory for the new application.

In Delphi 2005 I’ve tried to improve this message which now reads as follows:

"Creation of a virtual directory "yourvirtdir" on the local IIS Web server failed. The Web server may not be installed, not running or misconfigured. Without the virtual directory you will be unable to run this application however, you can manually create the virtual directory using the IIS administration tools at a later time. Would you like to create the application anyway?"

So, if you are using Delphi 8.0 and you encounter this error please substitute the above text in it’s place.

Posted by Steve Trefethen archive on November 12th, 2004 under ASP.NET, Delphi | 1 Comment »


Firefox hits 1.0!

Mozilla’s Firefox browser is officially 1.0! Congratulations!

Posted by Steve Trefethen archive on November 10th, 2004 under General | Comment now »


Problems with Imported Type Library Declarations in Delphi

Since I’ve been working on the HTML/ASP.NET designer one of the things I’ve noticed over the years is that our type library import tool improperly imports certain declarations particularly when it comes to const (or [in]) parameters. I’ve run into method declarations where at least one parameter is declared as “var” when in fact it should have been declared as “const”. At best, this results in no error but more frequently results in an application AV. I’ve talked to our type library gurus but unfortuantely this didn’t get addressed in Delphi 2005 thus our importer still suffers this problem. Don’t worry I’ll keep at it. :)

Anyway, if you have imported a type library and you are pulling your hair trying to call a method on some object try double checking that the method in question is actually declared correctly.

For example, IWebBrowser2.Navigate is declared as follows once imported using tlibimp.exe:

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant; var Headers: OleVariant); safecall;

Notice that the last four parameters are declared as “var” when in fact they should have been declared as “const”. If you try using this method you could run into problems as a result of this misdeclaration. The actual declaration should be:

procedure Navigate(const URL: WideString; const Flags: OleVariant; const TargetFrameName: OleVariant; const PostData: OleVariant; const Headers: OleVariant); safecall;

If you take a look at the declaration here on MSDN you’ll notice that all of the parameters are specificed as [in] in the Parameters section so it doesn’t make a lot of sense for them to be declared as “var“ in Pascal. So, if you can’t figure out why you’re unable to call an interface method from Delphi from a type library that you’ve imported double check that the method is in fact declared correctly.

On a bit of a side note, I generated the MSHTML.pas file that we use in the IDE with the following tlibimp.exe command line:

tlibimp -Hs- -Hr- -Fe- WINNTSYSTEM32mshtml.tlb

If you are running into problems specifically with MSHTML.pas please leave a comment and if there is sufficient interest I’ll look to post our version of MSHTML.pas to CodeCentral.

Posted by Steve Trefethen archive on November 1st, 2004 under Delphi, General | 5 Comments »


Delphi 2005: Revisiting the Welcome Page


Click to enlarge

In C#Builder 1.0 and now Delphi 8.0 the IDE has a Welcome page which is little more than Microsoft’s WebBrowser control hosted by the IDE pointing to a rather static HTML page. In it’s current incarnation the Welcome page is rather lacking but with a little creativity we can begin to unlock its potential. Throughout the development of C#Builder and D8 for that matter, there were many discussions with some really good ideas (and a few bad ones too :) as to what should appear on the Welcome page but unfortunately by the time RTM rolled around hardly anything that was discussed had actually been implemented. Since I work on the Internet features of the IDE and particularly the HTML/ASP.NET designers it was particularly frustrating to know the potential of the Welcome page and that we hadn’t even scratched the surface.

Scratching the Surface

During the development of Delphi 2005 I decided that it was time to revamp the Welcome page. Once again I heard similar mumblings about how to improve it and I finally decided it was time to act (I hadn’t worked on the Welcome page in either D8 or C#B). To that end I made a list (not necessarily in this order) of things I’d like to see on the Welcome page:

  1. Have a familiar look-and-feel comparable to many modern websites
  2. Provide dynamic content that’s relevant to the developer audience
  3. Provide extensibility allowing customers to tailor the Welcome page to fit their needs
  4. Provide a good example of XHTML layed out using CSS

The first task was to review the current files that make up the existing Welcome page and see what I could use and what would need to be changed. The layout that I had in mind was similar to many existing websites with a banner, a menu, the main content and a footer which the current design had two, the banner and the footer. I shuffled the HTML around and built the structure of the page that I felt met these requirements. Next, I started on the problem of dynamic content and how to keep the Welcome page fresh with new content but without requiring an entirely new infrastruture like Delphi Direct.

Enter RSS, XML and Javascript

Given the current popularity of RSS and the plentiful list of feeds provided by the BDN the decision of what content to include was pretty easy the hard part, or so I thought, would be getting the content onto the page without requiring that that IDE do all the work. RSS is a defined XML format and the easiest way to programatically work with XML is via a DOM which is easily accessible from Javascript. At first, I tried to create an implementation that wouldn’t require too much of my time because I still had obligations for the HTML/ASP.NET designer. What I came up with was a page listed the items from a single RSS feed (not to mention the recent projects table and a list of static links) but as it turns out this was just the beginning.

In the end, we created a Welcome page where the content is driven from XML files including the list of links and the available RSS feeds. Out of the box you will be able to choose from a list of 45 different RSS feeds from a dropdown right on the page.

Leveraging the Welcome Page for Your Team

Internally, we’ve setup our own development blog server where anyone on the team can blog about internal issues, announce new features as they show up in the product and notify the rest of the team about any potential problems. Basically, the Welcome page has become a way for us to improve communication throughout our entire team. You too can take advantage of this feature by setting up an RSS feed of your own and editing an entry in defaultProviders.xml located in .welcomepagexml under your Delphi 2005 directory.

I hope people find Welcome page 2.0 :) a lot better and I look forward to see where we can go from here! Send me a comment and let me know how you like or dislike it.

Finally, I’d like to thank Daniel Wischnewski of the The German Delphi Community for all his help. Thanks Daniel!

Posted by Steve Trefethen archive on October 29th, 2004 under Delphi | 1 Comment »


Pat Kerpan Borland’s CTO Joins the Blogsphere

Just wanted to welcome Pat Kerpan, Borland’s own CTO to the blogsphere. Welcome Pat!

Posted by Steve Trefethen archive on October 7th, 2004 under General | Comment now »


Next Up: Diamondback (Delphi 2005) and Formatting ASP.NET/HTML

To start off I’d like to address the issue of why we need a formatter at all. Our ASP.NET/HTML designer leverages the MSHTML control as its design surface and as a result we have to deal with the fact that this control discards any/all formatting including whitespace preservation when working with HTML. If you’d actually like to see the effect of using MSHTML without a formatter (trust me you won’t be happy) simply rename htmlfmt80.bpl in your Delphi 8 bin directory, start the IDE and answer Yes to the "continue to load this package" error and start editing an HTML file. This package contains our HTML formatter and without it you simply get back the raw HTML from the MSHTML control.

One decision we made in Delphi 8 was to format only the content of the file starting after the first tag. There were several reasons we did this but the main reason was that we wanted to format as little of the file as possible and since many pages have sections that contain stylesheet and scripting information we thought this would be a good idea. As it turns out this wasn’t a very good idea and in some cases can result in HTML being either mangled or duplicated neither of which is good. It is possible in Delphi 8 to undo the changes made in the designer using Edit|Undo but that’s not always acceptible either.

In Diamondback we’ve completely fixed this problem and not only improved our formatter but also have relaxed the rules for creating non-HTML documents using the ASP.NET designer. For example, if you want to create an ASPX page that returns only XML (like an RSS feed) simply start a new ASP.NET page and delete all of the contents except the @ page directive at the top of the file then start adding your markup and the designer won’t mess it by trying to turn it into an HTML page. As a side note, we’ve continued to monitor the progress of the W3C’s HTML Tidy open source project and have worked to keep our libtidy.dll up-to-date.

Posted by Steve Trefethen archive on October 4th, 2004 under ASP.NET, HTML | 3 Comments »


Next Up: Extensible ASP.NET Code Completion for 3rd Parties

Diamondback, like Delphi 8, supports code completion on ASP.NET server controls from within the code editor as well as the tag editor. This makes working with ASP.NET tags much easier and helps prevent mistyping tag and attibute names helping keep your development time productive. In Diamondback we’ve changed the loading of schema files that describe ASP.NET server controls such that third party companies that produce ASP.NET controls and make their controls work like first class citizens in the Diamondback IDE with full support for code completion and HTML Error Insight (a topic for another day).

To take advantage of this feature all you have to do is create a .xsd file that looks like the ones provided with Diamondback and place it in the “..schemasasp schemas” under your Diamondback root directory. When the IDE starts it loads all of the schemas from that directory for use with various IDE features like code completion. If you are a vendor who already has a schema file for VS.NET then typically just dropping that file into the above directory will add first class support to the Diamondback IDE.

[UPDATE: Dec 8, 2004] I just debugged a problem with the support for third parties supplying .xsd files for use with ASP.NET code completion. The IDE currently only supports “asp” and “borland” namespaces. We’ll be looking to fix this issue in a future update.
Posted by Steve Trefethen archive on October 2nd, 2004 under ASP.NET | Comment now »


Firefox just keeps getting better

Now that the 1.0 preview release of Firefox is out I just gotta say again how nice it is to have a browser that keeps getting better and better. Some of the new features that I really like are incremental search and the highlighting of the address bar when you browse to a secure site. Firefox has really made me look forward to getting each new release. My thanks go out to everyone who works to make Firefox the great application that it is today.

Posted by Steve Trefethen archive on October 1st, 2004 under General | 6 Comments »




Server Response from: blogs2.codegear.com