Archive for March, 2011

hcOPF - AV in Application with hcCodeSite defined

Sunday, March 27th, 2011

If you get an AV on shutdown of an application using hcOPF with the packages compiled with the hcCodeSite directive defined, the problem is likely the sequence of events.

My current project uses a global domain object representing the place of business. This domain object is created in the TDataModule.OnCreate event and destroyed in the TDataModule.OnDestroy event. The domain object uses a number of ThcParentedObjectLists which have CodeSite messages in the Clear method. Unfortunately, the hcCodeSite object used to send those messages was already freed in the Finalization section of the hcCodeSiteHelper unit prior to the TDataModule.OnDestroy event being called.

The workaround I used was to create and destroy my domain object in an initialization and finalization section I added to the datamodule.

Hopefully this post will save someone else the time it took me to figure this one out.

Delphi on Linux

Saturday, March 5th, 2011

Tonight I finally got my Delphi VMs running under Ubuntu 10.10 on my 6 core desktop with 16Gb RAM.  I figured this would make for a good machine to run multiple concurrent VMs.  The problem I faced was maintaining compatibility with VMWare Fusion on my Mac, and my VMs that were already on an SSD formatted with HFS+.  I really didn’t want to copy off the VMs and re-format the SSD.  It seemed like no matter what file system I chose, I couldn’t use it on all platforms without buying a commercial driver for at least one OS.

Initially Ubuntu would not start the VMs with VMWare’s Player because the filesystem on my SSD is HFS+ so it was ReadOnly under Linux.  I previously had installed a trial of MacDrive 8 in order to play the VMs under Windows 7, but there was nothing available from this vendor for Linux.  Then I stumbled across Paragon.   The installation was pretty straight forward, but I couldn’t get the drive to show up in the Computer window of Ubuntu even after I mounted it, and confirmed I had write access.  I’m no Linux guru, so I spent a number of hours reading man pages about filesystem and drive handling, trying to figure out what was going on.  I was just about to give up again, when I found this discussion.

Turns out I didn’t need to figure out why VMWare Player wasn’t seeing the drive after I mounted it.  The Ubuntu hfsplus support can write to an HFS drive if on your Mac you turn off Journaling.  You can do so by Right Clicking the Drive in Finder and Selecting Get Info.  Then in the Info window disable journaling and change the permissions for Everyone to be Read/Write.  You can always change the permissions in Linux if you prefer with the ’sudo chmod -R 777 .’ command.

With VMWare Player I can now use my existing VMs on my SSD without having to buy a license for VMWare Workstation.  Now I can use my VMs with Fusion on my Mac, and VMWare Player on my PC.  I now have Delphi on Linux…albeit not natively…yet ;-)

Is Linux Ready for the Desktop?

Saturday, March 5th, 2011

I recently downloaded Ubuntu 10.10 for my 6 core desktop machine thinking it would make for a good Host OS, as my intent was to run multiple VMs on this box.  I had previously tried Kubuntu and was impressed with the increasing user friendliness of the UI.  Ubuntu loaded quite easily onto my hard drive and played nice with the Windows 7 already installed, making the machine dual boot.  Everything was functional and the UI was relatively quick and intuitive.

Then  I tried to install an updated ATI video driver, and it crashed.  No big deal, Ubuntu installed a baseline configuration into the boot loader just like Windows does.  I went back to the last configuration and avoided the temptation to install the proprietary ATI video driver.

Getting my Apple Bluetooth keyboard was also quite straight forward.  I just had to use the Synaptic Package Manager to download and install Bluetooth support, and configured it under the System - Preferences - Bluetooth.  I just couldn’t get my Apple Magic Mouse to work.  With a little searching on their forums I found this link.  Obviously you can’t go to far off the beaten track before you’re back to command line scripts not for the faint of heart or those unfamiliar with Unix/Linux.

Linux may still be too unrefined for a novice user, but if you’re a tech head and want to avoid some licensing costs, or use Linux as a host OS for VMs it’s more than adequate IMHO.