All hail the T-bone

Yayy! According to the news today it looks like we’ll be having T-bone steaks in this country again. I love a bit of steak, me 🙂

Anyone for golf?

Had a nice morning today. Out at Castlegregory on the lovely little 9 hole course. It’s a bit hilly so it’s trouble for the old man.

101 uses for a dead cat

What does one do with a dead cat? It’s not mine, it just wandered into the garden and died last night. I’m not legally supposed to put it in the bin. There is the burial option, I suppose.

Rob’s had a babby

My mate Rob’s had a baby girl. Mother and child are doing well. When I heard on Saturday there was no name mentioned.

Debugging LoadPackage

Well this one is a complete pain in the ass. I’ve been trying to debug plugins in Delphi. It looks like the use of LoadPackage isn’t allowing us to debug the plugin. This is really annoying; it makes work difficult.

Annoying installations

This one is a real pain in the ass.
For some reason the installation of the Visual Fox Pro 8 SP1 OLEDB provider left all the registry keys installed were not readable by ordinary users, so when I tried to execute my application as an ordinary user didn’t work as the ‘provider wasn’t installed‘, whereas it’s just permissions.

Registry Keys that needed permission changes:
HKCR\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}
HKCR\CLSID\{50BAEEDA-ED25-11D2-B97B-000000000000}
HKCR\CLSID\{50BAEEDB-ED25-11D2-B97B-000000000000}
HKCR\VFPOLEDB
HKCR\VFPOLEDB.1
HKCR\Vfpoledb.ConnectionPage
HKCR\Vfpoledb.ConnectionPage.1
HKCR\VFPOLEDB.ConnectionPage
HKCR\VFPOLEDB.ConnectionPage.1

and the SOB still won’t work. Permissions on the files in OLDEB directory seem OK.
Then I had to copy registry information into the user’s environment:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes]
[HKEY_CURRENT_USER\Software\Classes\CLSID]
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}]
"OLEDB_SERVICES"=dword:ffffffff
@="VFPOLEDB"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\ExtendedErrors]
@="Extended Error Service"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\ExtendedErrors\{50BAEEDA-ED25-11D2-B97B-000000000000}]
@="VFPOLEDB Error Lookup"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\Implemented Categories]
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\Implemented Categories\{D267E19A-0B97-11D2-BB1C-00C04FC9B532}]
@=""
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\InprocServer32]
"ThreadingModel"="Both"
@="C:\\Program Files\\Common Files\\System\\ole db\\vfpoledb.dll"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\OLE DB Provider]
@="Microsoft OLE DB Provider for Visual FoxPro"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\ProgID]
@="VFPOLEDB.1"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\TypeLib]
@="{50BAEECA-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEED9-ED25-11D2-B97B-000000000000}\VersionIndependentProgID]
@="VFPOLEDB"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDA-ED25-11D2-B97B-000000000000}]
@="VFPOLEDB Error Lookup"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDA-ED25-11D2-B97B-000000000000}\InprocServer32]
"ThreadingModel"="both"
@="C:\\Program Files\\Common Files\\System\\ole db\\vfpoledb.dll"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDA-ED25-11D2-B97B-000000000000}\ProgID]
@="VFPOLEDB.ErrorLookup.1"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDA-ED25-11D2-B97B-000000000000}\VersionIndependentProgID]
@="VFPOLEDB.ErrorLookup"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDB-ED25-11D2-B97B-000000000000}]
@="VfpOLEDBConnectionPage Class"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDB-ED25-11D2-B97B-000000000000}\InprocServer32]
"ThreadingModel"="Both"
@="C:\\Program Files\\Common Files\\System\\ole db\\vfpoledb.dll"
[HKEY_CURRENT_USER\Software\Classes\CLSID\{50BAEEDB-ED25-11D2-B97B-000000000000}\Programmable]
@=""
[HKEY_CURRENT_USER\Software\Classes\TypeLib]
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}]
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0]
@="Microsoft OLE DB Provider for Visual FoxPro 7.0 Type Library"
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0\0]
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0\0\win32]
@="C:\\Program Files\\Common Files\\System\\ole db\\vfpoledb.dll"
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0\FLAGS]
@="0"
[HKEY_CURRENT_USER\Software\Classes\TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0\HELPDIR]
@="C:\\Program Files\\Common Files\\System\\ole db\\"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB]
@="Microsoft OLE DB Provider for Visual FoxPro"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB\CLSID]
@="{50BAEED9-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB\CurVer]
@="VFPOLEDB.1"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.1]
@="Microsoft OLE DB Provider for Visual FoxPro"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.1\CLSID]
@="{50BAEED9-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\Vfpoledb.ConnectionPage]
@="VfpOLEDBConnectionPage Class"
[HKEY_CURRENT_USER\Software\Classes\Vfpoledb.ConnectionPage\CLSID]
@="{50BAEEDB-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\Vfpoledb.ConnectionPage\CurVer]
@="vfpOLEDBDLink.ConnectionPage.1"
[HKEY_CURRENT_USER\Software\Classes\Vfpoledb.ConnectionPage.1]
@="VfpOLEDBConnectionPage Class"
[HKEY_CURRENT_USER\Software\Classes\Vfpoledb.ConnectionPage.1\CLSID]
@="{50BAEEDB-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.ErrorLookup]
@="VFPOLEDB Error Lookup"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.ErrorLookup\CLSID]
@="{50BAEEDA-ED25-11D2-B97B-000000000000}"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.ErrorLookup.1]
@="VFPOLEDB Error Lookup"
[HKEY_CURRENT_USER\Software\Classes\VFPOLEDB.ErrorLookup.1\CLSID]
@="{50BAEEDA-ED25-11D2-B97B-000000000000}"

Of course, if you’ve installed it somewhere else then you should not use the C: prefix, but whatever the installation drive is (e.g. j:).

Softie

I like movies. I like violent movies like Sin City. Old boy – disturbing, but just wow, what a story. Starship Troopers – people really need to figure out what it was all about, and dammit it was a wonderful telling of the book.
There I am tonight watching Sweet Home Alabama. Intially I didn’t think much of it. The problem is that I’ve developed a liking for the romantic comedy/dramas, and tonight was one of the many times.
We’ve got other flicks too. Office Space, which is a romantic comedy dressed up as a work sucks flick.
Then there’s my love of Japanese animation. I’m not a big fan of the giant robot genre, but I do have the essentials – Neon Genesis Evangelion. But what I really like are the ones that have just a touch of mysticism in them. A series which I picked up last Christmas when I was in New Zealand was Haibane Renmei, which is truly beautiful. It’s the tale of a girl with charcoal feathers, and tells a wonderful tale. More recently I’ve got the series Air, which is subtitled only, and I love it. It’s a story told over the course of a Summer. It has characters that you just fall in love with.
Ahh, zombie movies. Tonight I’m watching the Romero ‘Dawn of the Dead‘. I love the original version for the slow zombies and their inexhorable march after the humans.
I wonder how Rob and Edie are doing?

Cheap shot

snake

it looks like someone else noticed the Snake grows up. Mind you, the comment in the comic it’s a bit dodgy considering the person it’s coming from 🙂

It’s really not C++, is it?

If I want to find out about anything in Windows, you have to go through one of the bazillion Enum functions. These creatures take a callback function which they invoke with information on what is being enumerated, along with a variable (typically a void *) that contains data where you can put the results of the information (for example putting it on a list).
Interestingly, there are a few exceptions to the rule. File I/O tends to be of a different character – FindFirstFile(Ex), FindNextFile, FindClose. Of course the person writing the API could have added the word ‘File’ to the end of ‘FindClose’. That way they would all have a matching function style. But there’s no accounting for taste.
We wander over to the C++ (or practically all OO languages) and the design immediately changes to an enumerator. For C++ it’s the iterator, You get an enumerator in Java (and C#). The Enumerator doesn’t look like the old create another stub function to implement this handler trick, the handling code is inside a set of braces ({}).
I presume it’s the vagaries of the different teams working on the solutions to the problem and the fact that at the time people were designing the solutions they didn’t think there was a better way. With the enumerator, the caller keeps the state of the enumeration to themselves, they pass the current item and a pointer to the handling function. When the enumeration is finished you are guaranteed that there is no remaining state left over and that all the handles are cleaned up before you return to the caller.
It seems to be more of a caller vs. callee cleanup exercise. Nowadays we have scoped destruction of objects and garbage collection to deal with the state destruction. What’s more it means that you still aren’t depending on the potential binary instability of the oo function call definition. The typical OO implementation uses an implied this parameter passed to methods to carry the object information. It allows clever developers to create functions that mimic OO methods without actually being functions of the objects themselves.
If you’re clever, you can replace VMT entries with functions of your own creation that can be written in C. Convenient that.
An annoyance of programming Windows is that WinMain must be a static function. If you want to have a WinMain method, you need to perform trickery. One of the most regular methods of doing this is to use SetWindowLongPtr and store the address of the object in the private window information. This has the potential of being quite expensive. Every time you invoke the method you have to issue a GetWindowLongPtr call to extract the pointer, and then indirectly invoke the object’s implementation of WinMain.
There is a more evil mechanism that uses self rewriting code. But that’s for another time.