About/Contact

Steve Trefethen

Steve Trefethen is CTO at Wanderful Media.
Contact me

View my LinkedIn profile



Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Firefox hits 1.0!

November 10 2004 9:15PM
Mozilla's Firefox browser is officially 1.0! Congratulations!

FacebookDel.icio.usDigg It!

Tags:

Netflix now has RSS feeds

November 08 2004 9:15PM
I just noticed that Netflix has added an RSS feed for tracking my personal rental queue. That's sweet! Subscribed.

FacebookDel.icio.usDigg It!

Tags: ,

Delphi Desktop States and the HTML/ASP.NET Designer

November 01 2004 9:16PM

This issue has come up on the public Delphi newsgroups and I replied briefly with some additional information and thought that perhaps a better explaination of the issue might be useful/interesting at least to some people.

In C#Builder, Delphi 8.0 and now Delphi 2005 the readme states that the HTML/ASP.NET designer do not support switching of modes while the designer is visible.  Now you might be wondering why?  What's the problem?  Well here is the answer (in what is likely more detail than perhaps anyone wants):

The Galileo IDE (what we call it internally) which is the host for C#Builder, Delphi 8 and now Delphi 2005 supports two modes for the code editor window, docked and undocked.  This, more or less, means either a single window IDE or a floating version (like all previous releases of Delphi).  In order to switch modes a lot of “stuff” has to happen behind the scenes to ensure that the switch works properly.

The main reason the HTML/ASP.NET designer does not support switching modes is that the MSHTML control (which we use as the design surface) has to be destroyed and recreated.  That sounds easy enough but the problem is that you could be in the middle of a document that has not yet been save which is where the complications start.  In order to handle the destroy/recreate of the browser window the content has to be streamed off and then restored after the designer is recreated.  This isn't necessarily a problem either, although you'd lose context information like selection and caret position in the process, but it has to be performed at the right time in order to work correctly.  Currently, the IDE is implemented so that designers don't have to have intimate details of what the rest of the IDE is doing.  They get notifications when various events occur and can respond accordingly however the dock/undock event is not one of the events that is currently propogated to the designers making this a more difficult problem to fix.  In the end, it's simply come down to us focusing more on delivering improvements to the designer itself since we felt that this issue probably won't effect a large number of customers.  Having said that I will say that fixing this problem is on our radar and hopefully something we can get to soon.

FacebookDel.icio.usDigg It!

Problems with Imported Type Library Declarations in Delphi

November 01 2004 9:16PM

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- \WINNT\SYSTEM32\mshtml.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.

FacebookDel.icio.usDigg It!

Tags:

CSS Based Slide Show

October 29 2004 8:18PM
Joel on Software blogs about a CSS based slide show system called S5 which is really a cool idea. I can see lots of potential in using something like this particularly now that Delphi has an HTML based Welcome page.

FacebookDel.icio.usDigg It!

Tags:

Delphi 2005: Revisiting the Welcome Page

October 29 2004 8:17PM

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 .\welcomepage\xml 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!

FacebookDel.icio.usDigg It!

Tags:

Diamondback's official name "Delphi 2005"

October 13 2004 8:19PM
Now that the real product name has been rolled out I'll switch over from using the codename "Diamondback" to using Delphi 2005. Finally, I can stop writing "Diamondback or the next version of Delphi". :)

FacebookDel.icio.usDigg It!

Tags: