The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,927 other followers

Archive for October 27th, 2009

XP embedded – .NET Framework 3.0

Posted by jpluimers on 2009/10/27

The “out of the box” .NET 3.0 component in Windows XP Embedded drags way too many required components (like the System Restore Core) into your image.

So most people build their own .NET 3.0 component.

If you get errors like this when you make your own, then you didn’t get your dependencies right.

These are the dependencies for the .NET 3.0 framework:

  • .NET Framework 2.0
  • ASP.NET 2.0

These are the error messages you get when you forget the ASP.NET 2.0 dependency:

Of course I always get all my dependencies right :-)
(yeah right, not this time)

–jeroen

Posted in Development, XP-embedded | Leave a Comment »

Delphi – for … in on enumerated data types

Posted by jpluimers on 2009/10/27

I like enumerated type a lot.
The allow you to perfectly describe what the members of such a type actually mean, much more readable than a bunch of integer constants!

Given an enumerated type like TTraphicLightColors

type
  TTraphicLightColors = (Red, Orange, Green);

I always wondered why  – since the for ... in statement was added to the structured statements part of the Delphi language – it is not possible to use a for … in statement like the this:

</span>
<pre>var
  TraphicLightColor: TTraphicLightColors;
begin
  try
    for TraphicLightColor in TraphicLightColor do
      ShowValueAsTraphicLightColor(Ord(Value));
    // [DCC Error] EnumerationEnumeratorDemoProcedures.dpr(63): E2430 for-in statement cannot operate on collection type 'TTraphicLightColors'
end;

Somehow, for … in expects a collection type.
A request for [WayBack] the for … in do on enumerated types compiler feature is in QC, but it is closed with reason “Won’t do”.

Back in Delphi 2007, I tried working around this by writing a type implementing the GetEnumerator pattern myself, but got [WayBack] Internal Errors when compiling anything but the most basic sample.

Until today, where I found how I could get that most basic sample to work!
It is an example on how you could implement this: it is research, so you decide if you find the result practical enough to use yourself.

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, F2084, QC, Software Development | 20 Comments »

 
%d bloggers like this: