RSS feed

Linkedin Profile

Tags:
economy
programming
seattle
things that bug me
wall art

Posts by month: 12/08 (2)
10/08 (2)
08/08 (1)
06/08 (2)
05/08 (1)
03/08 (3)
02/08 (1)
01/08 (2)
12/07 (2)
11/07 (1)
07/07 (1)
05/07 (2)
02/07 (1)
01/07 (1)
12/06 (1)
11/06 (1)
10/06 (1)
08/06 (1)
07/06 (1)
06/06 (2)
05/06 (1)
04/06 (2)
02/06 (1)
01/06 (2)
12/05 (3)
11/05 (2)
09/05 (5)
08/05 (5)
07/05 (7)
06/05 (3)
05/05 (6)
04/05 (8)
03/05 (7)
02/05 (7)
01/05 (6)
12/04 (2)
11/04 (3)
10/04 (5)
09/04 (3)
08/04 (5)
07/04 (5)
06/04 (4)
05/04 (4)
04/04 (9)
03/04 (4)
02/04 (3)
01/04 (5)
12/03 (1)
11/03 (14)
10/03 (8)


GPCP test drive
2003-11-03
AOP for GPCP is on the way, so I decided on the weekend to come to grips with GPCP in its current version. I want to put together a fantasy day-trading application so I can compete with my family, so I thought I would attack both problems at once and code it all in CP. Just to spice things up a little, I don't know Pascal (or Component Pascal).

On the whole it was pretty easy to get the hang of. I was able to knock out some working code quickly, and the interaction with other .NET assemblies was fairly seamless.

However, I did have a couple of problems:
  1. ValueType records - I started by coding several record types and associated procedures in GPCP. I then switched to C# to write some GUI code on top of these GPCP records. To my dismay, I discovered the records had been split into a Boxed_XXXX, containing all the methods, and a field with an instance of XXXX, containing all the fields. After messing around for a while I discovered that declaring the record EXTENSIBLE solved the problem.
  2. Cast in CP? - This is probably down to my own ignorance, but it proved frustrating. Most of the time, CP arrays must have a statically declared, constant size. This wasn't the behaviour I needed, so I decided to use System.Collections.ArrayList. Unfortunately, the get_Item method (and a lot of others I wanted) returns an object instance. How can I cast it to a strongly-typed pointer in CP? The "solution" I settled on was to create strongly-typed wrappers in C# that took the casting out of my CP code. This was all fine in theory...
  3. N2cps broken - To interact with my C# strongly-typed collection from CP I needed to create some sort of header file using N2cps. At least that is what I think. Anyway, N2cps fell in a heap at startup, with a message about an incorrect .NET version. I am running Everret, so who knows? I'll try it on my Whidbey machine some other time.
Back to weblog