Archive for March, 2007

Using a .NET Assembly via COM

Saturday, March 31st, 2007

My article on CodeGear Developers Network.

Abstract: Using .NET Assemblies as COM objects in Win32 programs is simple, once you are familiar with the necessary hoops. This article outlines the steps necessary and provides a few tips to improve your experience.

I needed to do this, and wasn’t able to find any step-by-step guide, so I wrote one.

al assembly attribute cache com command dll exe file following gac gacutil key myassembly net object path step strong tool

created at TagCrowd.com

Code Profiling with Non-Breaking Breakpoints

Friday, March 30th, 2007

My article published on CodeGead Developer Network.

Abstract: Sometimes it is nice to know how long a specific piece of code takes to execute. Your IDE may actually provide a means to accomplish this using non-breaking breakpoints and the event log. Get precision results from specific sections of your code.

advanced api available break breakpoint calls change changes checkbox click code create ctrl debug delphi dialog display elapsedms eval event execution expression feature function gettickcount group ide instead jim lines list log message milliseconds non-breaking notice number profiling program properties really running second since software source tip useful usually windows

created at TagCrowd.com

Visual SourceSafe is the SPAWN of the DEVIL!

Saturday, March 24th, 2007

As anyone who has used Visual SourceSafe will tell you, it is the SPAWN of the DEVIL! Well, it would appear Microsoft isn’t denying it. They have a picture of it next to the devil on their product page.

Visual SourceSafe is the SPAWN of the DEVIL!

Check out those horns!

[Source]

Watch my Advanced Downloads session

Sunday, March 18th, 2007

If you missed my Advanced Downloads Session from CodeRage 2007 you can still catch it. You have two choices:

  1. The full resolution download is available from CodeGear.
  2. A low resolutions stream is available on Google Video. Hopefully I can figure out how to get them to offer it in high resolution. . . .

Delphi BITS Demo

Sunday, March 18th, 2007

This demo is currently MIA, but I will hunt for it some more in the next few days. If all else fails I will re-write it. Sorry about that!

UPDATE: I recreated the demo.

HTTP Range Requests Script

Sunday, March 18th, 2007

This is the script I use to demonstrate HTTP Range requests through Telnet. Just copy and paste each block of code (including the trailing blank line) into a command window and it will run telnet and make the HTTP request.

telnet www.davinciunltd.com 80
HEAD /http/httptestfile.txt HTTP/1.1
Host: www.davinciunltd.com
Connection: close

telnet www.davinciunltd.com 80
GET /http/httptestfile.txt HTTP/1.1
Host: www.davinciunltd.com
Connection: close

telnet www.davinciunltd.com 80
GET /http/httptestfile.txt HTTP/1.1
Host: www.davinciunltd.com
Range: bytes=115-154
Connection: close

telnet www.davinciunltd.com 80
GET /http/httptestfile.txt HTTP/1.1
Host: www.davinciunltd.com
Range: bytes=78-113
Connection: close

telnet www.davinciunltd.com 80
GET /http/httptestfile.txt HTTP/1.1
Host: www.davinciunltd.com
Range: bytes=127-127,115-154
Connection: close

HTTP Range Requests in Delphi

Sunday, March 18th, 2007

This is my RainbowImage demo from my Code Rage 2007 presentation.

Demonstrates using HTTP range requests to download parts of multiple files and joins them together.

Uses Indy 10, but could easily be adapted to Indy 9.

Normally you would want to download parts of the same file, but for this demo is uses different color versions of the same image.

The images may be removed later if they become too much of a bandwidth drain. If they do then an updated demo will be provided which uses alternative image sources.

The images it downloads are colorized bitmaps of the wallpaper created by Zoltan Komaromy. The original wallpaper can be downloaded from MandalaPainter.com. Thanks to Pawel Glowacki for the link.

FTP Chunker

Sunday, March 18th, 2007

This is the FTP Chunker class and example I wrote for my Code Rage 2007 presentation.

It allows the retrieval of any part of a file via FTP. The FTP server must support the REST command, which most do.

Uses Indy 9 - Written and tested on Delphi 2007.

ftpChunk.zip

Programming with BITS in Delphi

Sunday, March 18th, 2007

BITS is Microsoft’s Background Intelligent Download Service. It was added in XP to allow downloading of security patches in the background. In the Platform SDK Microsoft provided a COM interface to allow developers to work with BITS. Unfortunately it is a bit of a pain to actually get to the interface, especially if you are not using Visual Studio. To make it easier for Delphi developers to work with BITS, I am providing my imported Type Library for the BackgroundCopyManager.

Alternatively you can use the JEDI Win32 API Library available on Sourceforge. It has the Bits interface (version 1.5) split into a few different files (JwaBits1_5.pas, JwaBits.pas, JwaBitscfg.pas, and JwaBitsMsg.pas [although they reference other included files]) and cleaned up a little bit. In addition it includes a number of other useful Delphi wrappers for Win32 API’s. I recommend this library over the raw TLB import. My demo will work with either one.

UPDATE: I recreated the demo and added it to the archive!

(more…)

CodeRage

Thursday, March 15th, 2007

My source code, some resources, additional information and links from my CodeRage presentation on Advanced Downloads will be available here shortly. Check back.