8.03.2004

I am the fuckin' shit, dude... i so just got ninja on c#'s ass and busted up some phatty code poetry, man. For all you coders out there, i couldn't get an ESRI ActiveX-based MapControl to host inside of an Infragistics-provided DockableControlPane control. In short, it seemed like it was a problem activating a System.Windows.Forms.ContainerControl. Or something to the effect of it. (it's complicated, but if anyone ever has a problem like this and would like to see the resolution let me know).

See, the mapcontrol derives from AxHost. This class has an Activate method which likely calls Activate on the embedded activex control, but also seems to call Activate on the AxHost.ContainerControl object. Generally that's a Windows Form, but for various reasons I couldn't have my mapcontrol hooked to a Form like that. Hence, when DockableControlPane would invoke the AxHost.Activate() method, it would try and activate its containercontrol, but oops, shit, if it's null, it'll throw a nice ArgumentException. Alas.

Well, UserControl to the rescue! I just built my own, since it derives from ContainerControl, and dropped a MapControl onto it. Then addded the UserControl to my DockableControlPane. Bickety-bam, the proverbial motherfucker is rubble.

Whew. It feels nice when you figure out a problem you've been freaking out about for two weeks at work. :)

Peace, reader.

No comments: