Igence

igence and software

Our views, opinions and top tips on software development

We have a winner!

Wednesday, 10 September 2008

Congratulations to our very own Charles Bailey who won the Code Critique competition in the August edition of {CVU}, the magazine of the ACCU.

You'll have to join the ACCU to read Charles' critique, however it's thoroughly recommend if you wish to join a community of developers who care about programming and want to keep in touch with what's going on.

Labels: ,


posted by Steve  # 10:43   0 Comments

Fun with ShellExecute

Monday, 16 June 2008

To provide context sensitive help for an application, it is quite useful to have HTML pages available which can be opened by the application when the user presses a key. To make things simple, it's also nice to have named anchors within the HTML so that the application doesn't need a separate page for each help item.

The obvious way to do this is to put the HTML files in a folder somewhere and use the Windows ShellExecute command to open the browser with the specified URL. If the pages can be fetched from a HTTP server, then there is no problem using named anchors, but if your pages are just files in a folder, you need to use the file: protocol. However, the file: protocol requires absolute paths, which means you need to know where your folder is. On top of that, you can't use named anchors either.

The solution I found is to get the application to create a temporary HTML file, on the fly, containing a meta refresh tag, which redirects to the URL (with the named anchor) you need. eg.


<meta HTTP-EQUIV="REFRESH" content="0; url=Help\Pages\Index.htm#subsection">


You then use ShellExecute to open the temporary file instead. If the temporary file has the extension .htm you don't need to specify the protocol because it uses the extension to determine that the file should be opened in the browser.

This means you can use a relative path and a named anchor.

Labels: , , ,


posted by Nige  # 10:32   0 Comments

Visual Studio Output Window

Tuesday, 15 April 2008

Ever have problems with your output window in Visual Studio? Sometimes I find that mine won't automatically scroll when building - I have to keep dragging the scrollbar to get the most recent output into view.

It's not immediately obvious, but It turns out that the cursor needs to be at the end of the output for it to keep the most recent output in the window. A quick Ctrl-End will get the cursor to the end of the output.

Labels:


posted by Steve  # 16:14   1 Comments