COM, STA, apartment, reentrancy, re-entrancy

are you getting cyclic function call graphs in your STA (or multiple STAs) ?
so you’ve probably heard of re-entrancy.

if you’re re-entrancy are due to a COM call waiting on some handles (WaitForSingle/MultipleObject/s), you can replace it with


What this method does is wait for your handles, but also handles new COM calls (through a simple message pump), which is just fantastic.
If you have custom message processing, CoWaitForMultipleHandles will not execute this custom behavior, for more info on that look here: http://blogs.msdn.com/timng/archive/2006/09/06/743795.aspx

from flickr to zooomr

flickr recently told me i reached their 200 picture limit. it took me two years i think.
now they won’t let me upload anything without deleting old stuff.
what can i say, i’m going to have to take my picture together with all the eyeballs watching them to another site that isn’t so uptight.

so here’s my first zooomr picture:

Flickr throwing me out

too bad, i liked flickr very much.

BHO (IE Addin/extension) manifest visual styles xp

Tried to cram as many relevant words in the title for this to come up in Google when people search for it.

Adding visual styles (common control manifest) to a BHO (Browser Helper Object, or in it’s other names Browser-Extension/Add-in/Band-Object) is not trivial. Thankfully enough our good friends at MS didn’t bother to document this, like a gazillion other things…

here goes:

  • Copy over a manifest file from some old project or download one from the net, they are all the same, just change the project name inside and then rename your manifest to ‘mydllfilename.dll.manifest’, so if your extension is ‘wagamama.dll’ your manifest is ‘wagamama.manifest.dll’.
  • Right-click your resource root in VS, hit ‘Resource includes’, then add this to ‘Compile-time directives’:
    ISOLATIONAWARE_MANIFEST_RESOURCE_ID
    RT_MANIFEST “
  • Go to stdafx.h or somewhere and:
    #define ISOLATION_AWARE_ENABLED 1

You’re good to go.

But if I really wanna know what’s going on, what are the catches ?

  • you use ISOLATIONAWARE_MANIFEST_RESOURCE_ID instead of CREATEPROCESS_MANIFEST_RESOURCE_ID
  • you need to define ISOLATION_AWARE_ENABLED and set it to 1 or something, if you just define it you get a compile error because of how MS write their code, just look at this:
    winnt.h (line 9153):
    #if (_WIN32_WINNT > 0×0500) || (_WIN32_FUSION >= 0×0100) || ISOLATION_AWARE_ENABLED // winnt_only
    doesn’t that compile wonderfully… you guessed right, when MS bothers to talk about this directive they just tell you to define it, they never expected somebody not to define _WIN32_WINNT to something lower than 0×0500 (xp ?)… so they basically wrote code that never evaluates, ain’t that funny….

More (incomplete) info on this can be found:
http://support.microsoft.com/default.aspx?scid=kb;en-us;830033
http://www.ookii.org/showpost.aspx?post=12

Some nice stuff from 2006

Taking an opportiunity to share my excitement about some stuff

Movies:

These weren’t released on 2006 but I watched them only in 2006, I think, anyhow they are great movies

The life aquatic – A fantastic movie, sort of mockumentary about that famous French diver. A good friend of mine says that watching it is like going on a short vacation. It also has one of the best soundtracks I’ve heard in a long time.

Howl’s moving castle – A great animated/drawn Asian film by this guy Hayao Miyazaki. I first saw a poster of it in a subway walkway in London I think… I was simply awe struck by the concept of a moving castle, sort of explains what breaking conceptual barriers is all about. Watching the movie was simply an amazing experience, that castle…

Hello my name A Borat – I have so much respect for this guy, even more because he’s partly Israeli and all… I always have the feeling that if I’d focus myself entirely on something like this, I could pull it off. Watching Baron Cohen do it first of all makes me laugh my ass off, because I appreciate cheap yet sophisticated humor (Dumb & Dumber, Adam Sandler tapes, the Chinese restaurant gag, “your daughter kicked my dog…” and so on).

Music:

We Run This by Missy Elliot – Bumped into this song while running, whow what a song. Not odd for someone like me who likes both Rahmaninov, Snoop-Dog, Metallica and recently Wolfmother.

Wolfmother – Apple Tree and Woman – My cousin Mike played me these and I fell for them immediately.

Nintendo DS Lite


I got a DS-Lite during my last stay at the states.

I also ordered an EZ-Flash IV Lite, which is a flash card for the DS Lite that allows you to put tons of (your backed up) roms on a flash card and play them off the DS Lite.

The DS Lite is lots of fun packed into a small console. It has Wifi so you can play against people from all over the world. It’s got TWO screens, one of which is a touch screen, which brings new designs for interacting with games. It also manages to produce some semi-surround sound which is cool, and it’s just fun.

What games do I recommend:

  • Mario Kart
  • The New Super Mario
  • Fifa Soccer 2006 (just fun and runs great on the DS)

A few more games that I’ve tried and may be interesting:

  • Spiderman II
  • Elite Beat Agents (highly recommended for some reason)
  • Mario Hoops (nice interface)
  • Trauma something