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,854 other subscribers

Archive for the ‘Delphi’ Category

Delphi XE2 installation instructions on Windows and Mac (#ekon15 conference)

Posted by jpluimers on 2011/10/24

If you are attending the EKON 15 conference and want to prepare your laptops for some hands on experience, please follow the guidelines below.

I’m looking forward meeting a lot of interesting people, and having a great conference!

And if you are not attending, the below guidelines will help you get started doing cross platform FireMonkey development in Delphi :)

Installation instructions

Installation instructions on the Windows PC

  1. Install RAD Studio XE2 and the on-line help (use the default settings in all steps)
  2. Install InterBase XE Developer edition

Installation instructions on the Mac

For FireMonkey Mac OS X development

  1. Copy the file setup_paserver.zipto your Mac. Usually you can find it in here (X: is your Windows drive):64-bits system: X:\Program Files (x86)\Embarcadero\RAD Studio\9.0\PAServer32-bits system: X:\Program Files\Embarcadero\RAD Studio\9.0\PAServer
  2. Unpack the file setup_paserver.zip on your Mac (you will get the file setup_paserver)
  3. Run the setup_paserver on the Mac.
  4. InterBase Developer edition:follow the general Installation instructions on the Embarcadero site,followed by the speficif Mac OS X instructies on the Embarcadero site.

For Apple iOS (iPad, iPhone, iPod touch) development

  1. Download and Install Xcode 4 from the Apple site (you need to register for an account first) http://developer.apple.com/xcode/
  2. Copy the file FireMonkey-iOS.dmgto your Mac; Usually you can find it in here (X: is your Windows drive):64-bits system: X:\Program Files (x86)\Embarcadero\RAD Studio\9.0\FireMonkey-iOS32-bits system: X:\Program Files\Embarcadero\RAD Studio\9.0\FireMonkey-iOS
  3. The file FireMonkey-iOS.dmgis a Mac disk image.Mount the DMG image on your Mac. It will be openend in /Volumes/FireMonkey-iOS/ and you will see 2 installers.
  4. Install both in this order:a. fpc-2.4.4.intel-macosx.pkg (it tells you that it will take 2 minutes, usually it will take less time)b. FireMonkey-iOS-XE2.pkg (it tells you it installs in “less than a minute”, usually it takes much longer, and can take more than 15 minutes)
  5. In the Mac Finder, Eject the mounted DMG

See also these two online instructions:

–jeroen

Posted in Delphi, Development, FireMonkey, Software Development | 2 Comments »

SVN 1.7, TortoiseSVN and CollabNet 2.1.0 released earlier this week

Posted by jpluimers on 2011/10/14

Right after the Subversion SVN 1.7 release earlier this week, 3rd party providers announced new versions of their products too.

These are the updates of the ones I use most often:

Two major improvements for me:

  1. Improved meta data (read: only one .svn directory in the root of a working copy)
  2. Faster HTTP speed

Please also read Uwe Schuster‘s (the guy that implemented the version control integration for SVN and Git in the Delphi IDE) blog post on a few things you need to watch when upgrading to Tortoise SVN 1.7.

–jeroen

Posted in Delphi, Development, Software Development, Source Code Management, Subversion/SVN | Leave a Comment »

Impersonation on the iSeries: Changing Profile User

Posted by jpluimers on 2011/10/12

When running on Windows, changing the current user is called impersionation.

There are various ways to do this in Windows, including

On the iSeries, there is only one way, as everything goes through the same API: use QSYGETPH (Get Profile Handle) to verify a username/password combination and obtain a handle to the authentication token, then use QWTSETP (Set Profile Handle) to change the user currently signed on, as for instance mentioned by Colin Williams directing to the CHGCURUSR tool on FreeRpgTools.com and an article on Swapping AS/400 User Profiles by Shannon O’Donnel that comes with source code.

On the iSeries, when you are done, you should use QSYRLSPH (Release Profile Handle) when done impersonating, and you need to get the handle from the original user profile if you want to return to it.

The IBM documentation contains a small sample with QSYGETPH, QWTSETP and QSYSRLSPH that sets and restores the profile handle (edit 20120214: it got moved to http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fapis%2Fapiexushand.htm)

Note that on both Windows ans iSeries, impersonation within a process/thread will make it run in the new context, but the process still keeps the identity of the user that started the process.

If you want to change that, then on both you need to start a new process from the impersonated thread.

In Windows, you can combine the impersionation and the creation of a new process by using the CreateProcessWithLogonW function (as mentioned at the Old New Thing by Raymond Chan). I’ve yet to find an equivalent on the iSeries.

–jeroen

Posted in .NET, C#, Delphi, Development, iSeries, Software Development | Leave a Comment »

EKON 15 conference news and discount (German text at the end of the blog post): Cary Jensen presents the keynote @caryjensen #ekon

Posted by jpluimers on 2011/10/11

EKON 15 – first day has many English sessions

From 26 till 28 of October, I’ll be speaking at the 15th EKON conference at the Renaissance Hotel in Düsseldorf, Germany.

I just sat next to the conference organizer, and he proudly announced that well known and long time Delphi guru Cary Jensen will be presenting the keynote on the evolution of Delphi from Delphi 1 to XE2.

I still have the disks marked “Wasabi” and “Mango” from the early 90s (and funny that Microsoft is using the same name for a 7.5 product, where Delphi 1 was a real revolution).

Next to the German sessions, there will be English sessions as well: Cary also does his other sessions that day (on cross platform development, windows services, and RESTful webservices).

Being a German conference, most of the other sessions will be in German, but it is good that the English ones are all in one day: you get a one-day visit to conference as a non-German speaker, get a discount and visit the beautiful city of Dusseldorf (especially the Altstadt is recommended).

Contact me for more information on discounts: there are both discounts for the English day and the full the whole conference.

On the EKON 15 site there is a nice conference planner and session overview.

Last but not least, on friday after the conference, Edwin van der Kraan and I will present a full day Delphi XE2 workshop covering x64, new VCL and of course FireMonkey cross platform development (so bring your Mac and iOS devices with you!).

15. EKON Konferenz – Delphi XE2 und mehr…

Vom 26. bis zum 28. Oktober findet die 15. Entwickler Konferenz (EKON) im Renaissance Hotel in Düsseldorf statt. Ich werde als Speaker ebenfalls vor Ort sein.

Als ich gerade mit dem Organisator der Konferenz zusammen saß, verkündete er mir stolz, dass Cary Jensen, bekannter und langjähriger Delphi-Guru, auf der EKON 15 eine Keynote zu Delphis Evolution von Delphi 1 zu XE2 halten wird.

Ich bin immer noch im Besitz von Disketten aus den frühen 90er Jahren, die mit „Wasabi“ und „Mango“ beschriftet sind (witzig dabei ist, dass Microsoft den gleichen Namen für ein 7.5-Produkt nutzt, während es bei Delphi 1.0 eine richtige Revolution gab).

Neben den deutschen Sessions werden auf der EKON auch Sessions auf English angeboten: Cary wird unter anderem auch über Cross-Plattform-Entwicklung, Windows Services und RESTful Web Services sprechen.

Zwar werden die meisten Sessions auf Deutsch gehalten, jedoch gibt es diesmal eine Besonderheit bei den englischen Sessions: Diese finden an einem Tag statt!
Somit können auch die Nicht-Deutschsprachigen für ermäßigten Eintritt an den Sessions auf Englisch teilnehmen und ganz nebenbei die schöne Innenstadt Düsseldorfs erkunden
(besonders die Altstadt ist sehr empfehlenswert).

Zu guter Letzt präsentieren Edwin van der Kraan und ich am Freitag einen ganztägigen XE2 Power Workshop zu x64, New VCL und natürlich zur FireMonkey Cross-Plattform-Entwicklung (bringen Sie also Ihre Macs und iOS-Geräte mit!).

Bei weiteren Fragen, Interesse und Infos über die Ermäßigungen können Sie mich gerne kontaktieren (Ermäßigte Preise gibt es sowohl für den English-Day als auch für die Gesamtkonferenz). Auf der Website finden Sie eine übersichtlichen Zeitplaner, die Sessions im Überblick und alle weiter Informationen zur Entwickler Konferenz.

–jeroen

Posted in About, Conferences, Delphi, Development, EKON, Event, Personal, Travel | Leave a Comment »

Registry Search-Replace tools – correcting the havoc after a data migration

Posted by jpluimers on 2011/10/07

A while ago, I found myself in the situation where at a corporate client the user profiles had moved on the LAN. Very understandable: it was one of the migrations towards DFS. They notified this in advance, so I made backups of everything (home drive and user profile) just to make sure.

The move indeed caused all sorts of havoc, because the data was moved, but the registry was only slightly modified.

Some of the errors I got were like these:

[Internet Explorer - Search Provider Default]
A program on your computer has corrupted your default search provider setting for Internet Explorer.

Internet Explorer has reset this setting to your original search provider, Live Search (search.live.com).

Internet Explorer will now open Search Settings, where you can change this setting or install more search providers.
[OK]

and

[Desktop]
\\old-server\old-share\user-id\Desktop refers to a location that is unavailable. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location.
[OK]

Below some of the ramblings on what I did to get everything working again, including registry searches when you are not allowed to run RegEdit, searching through text, and the places in the registry that had to change. Read the rest of this entry »

Posted in .NET, C#, Delphi, Development, Encoding, Power User, Software Development, Unicode | Leave a Comment »

When you are bitten by normally having the luxury of a current development environment

Posted by jpluimers on 2011/10/06

Sometimes you are at clients that don’t fully appreciate the luxury of keeping their development environment current.

This case a client still using Delphi 2006, where I promptly ran into a compiler error that was solved 5 years ago: a “F2084 Internal Error: C11919” at the end of the method.

begin
  if RMQResult.Create(CompCode, Reason).IsOK then
//...
end; // [Pascal Fatal Error] MQObjects.pas(668): F2084 Internal Error: C11919

The cause is that the compiler barfs at calling a method on a freshly created record.
The function result is an intermediate, which is not handled correctly (fixed in Delphi 2007).

This is not only for record intermediates: reusing an intermediate like the result of Pred() will crash the compiler in Delphi 2006.

The workaround is introducing a real variable.
This works:

var
  MQResult: RMQResult;
begin
  MQResult := RMQResult.Create(CompCode, Reason);
  if MQResult.IsOK then
//...
end; // compiles fine

–jeroen

Posted in Delphi, Development, F2084, Software Development | 4 Comments »

CRC32 Calculators in Delphi and .NET

Posted by jpluimers on 2011/10/05

For a couple of projects, I needed to calculate CRC32 hashes (they same CRC that for instance is used in ZIP files).

A few of the projects used C#, others used Delphi, so here are a few references:

FileFormat.info has a good on-line hasher (that does CRC32, md5 and a bunch of others) accepting both strings, hex bytes and files.

–jeroen

via: CRC32 Calculator.

Posted in .NET, C#, Delphi, Development, Software Development | 1 Comment »

I won’t make it to CodeRage this year, the Diving instructor and a diving buddy of my retarded brother just died in a diving accident: counselling to do

Posted by jpluimers on 2011/10/03

I’m really sorry to announce it, but I’m still shocked, while in the mean time providing counselling to my brother, providing the newspaper interviewer with background information on how diving with handicapped/retarded people works, and helping hands where I can.

It means I won’t make it to CodeRage this year. With pain in my heart, but even more pain for Fred Snijder (diving instructor) and Nico Laan (diving buddy), their families, friends, pupils, and co-divers. Those guys will be dearly missed, and leave an inexplicably large hole behind (no pun intended).

Just read, and shiver imagining that two of the most well trained and precautionary diving people I know just, well, died on October, 1st.

I’m in an utterly confused state of mind: sad, confused, supportive, etc.

Germany

2 Dutch divers died in German lake

The bodies of 2 divers were recovered on Sunday at a depth of 50 metres in the Kreidesee in Hemmoor, 30 miles southeast of Cuxhaven, following a diving accident.

The Delta Duikteam of Alkmaar had a group of 6 people diving at the 60-metre deep lake, 2 surfaced without problems, 2 others required to make an emergency ascent but they are not listed in life-threatening condition. Of the 2 missing divers whose bodies were found yesterday, 1 was an experienced instructor. 3rd October 2011

–jeroen, confused.

via: www.safetynews.co.uk

Fundiving    Kreidesee    Zevensprong    Delta Duikteam Alkmaar    AD newspaper    CodeRage

 

 

Posted in About, Delphi, Development, Personal, Software Development | 7 Comments »

EditorLineEnds.ttr – what is it?

Posted by jpluimers on 2011/09/29

Sometimes when you start Delphi 2005..2010 multiple times, you get an error message similar to this:

[Error]
Cannot create file "C:\DOCUME~1\username\LOCALS~1\Temp\EditorLineEnds.ttr". The process cannot access the file because it is being used by another process.
[OK]

Edit: It looks like some people have issues with Delphi 2006 and higher in combination with Windows 7  and higher and KB2982791 or KB2993651 installed. I only do for Delphi 2006 (for 2007 and higher I use the IdeFixPack from Andreas Hausladen). Thomas Mueller wrote a workaround which works in Delphi 2006 and up: Delphi 2007 error: “Cannot create file C:\Users\Admin\AppData\Local\Temp\EditorLineEnds.ttr” – Stack Overflow.

Since there are [WayBack] are [WayBack] a [WayBack] few [WayBack] QC [WayBack] entries on the EditorLineEnds.ttr file: what is it?

In fact, there are two files in that %TEMP% directory: EditorLineEnds.ttr and EditorLineEnds.for

EditorLineEnds.ttr is a TrueType font (you can copy it to EditorLineEnds.ttf and view it using the font viewer that Windows has built-in). Read the rest of this entry »

Posted in Delphi, Development, Power User, QC, Software Development | 2 Comments »

Delphi XE2 Update 1 is out; be sure to get it.

Posted by jpluimers on 2011/09/28

I’m at the BASTA.NET conference, so I need to keep this short:

Be sure to get Delphi XE2 Update 1 and read the release notes. You will need it in order to apply future updates, which will come soon and often: a big change when compared to previous product releases.

You will need do a full uninstall/install cycle, which will take a while.

On the Mac, you will also need to uninstall/install the Delphi XE 2 FireMonkey iOS support package as well.

It is worth it: tons of bug fixes, and an importent fix to comply with licensing (the first XE2 version had a license issue with the GLScene: if you have 3D apps, then Installing Update 1 and rebuilding your source will ensure that your applications have a valid redistributable license).

Bug fixes (over 120!) are in these areas:

  • FireMonkey design-time and run-time fixes
  • New VCL Styles
  • VCL Styles design-time and run-time fixes
  • IDE fixes to improve stability
  • C++ and Delphi compiler fixes

–jeroen

Posted in Delphi, Development, FireMonkey, Software Development | 4 Comments »