11.21.2003

oh! i got my hair cut the other night so that kicks ass. perhaps the "vehicle of destruction" will get its oil swapped out tomorrow, if it's lucky, and it behaves. Damned thing...

Btw, my TOCControl's .Buddy property was null cause i'm a tard. Thing is, the primary class for the MapControl (the ultimate Type of the Buddy control) is AxMapControl, which is in ERSI.ArcGIS.MapControl i think. But... the hook wrapper class i designed to be used in the ICommand.OnCreate() method was looking for an IMapControl2. Bunk!

But why is that bunk? Cause the fucking IMapControl2 interface isn't even implemented by AxMapControl! Grr!

so if you go

(ICommand)myPlugin.OnCreate(this.axMapControl1);

the the conditional in OnCreate like

public void OnCreate(object hook)
{
if (hook is IMapControl2)
{
//do shit
}
}

won't get entered. In other words, we won't do shit. Lame! But, if we call the OnCreate method like:

(ICommand)myPlugin.OnCreate(this.axMapControl1.Object)

all works well. Evidently the Object property returns some instance of the coclass. wtf. I also hear through the grapevine that the Ocx property of axMapControl1 will return a valid concrete class instance that implements IMapControl2.

Why split up the namespaces though? Just to facilitate the design-time ocx control? But why not lump the coclass and the interfaces and the events into one master namespace? who knows, i'm sure esri has their reasons. just makes it fun when one spends two or three hours discovering said little idiosyncracy. Alas. I'm done ranting now - i'll go read my book and leave you guys alone. :)

peace out, faithful g's of progress!

No comments: