protected override HandleRef BuildWindowCore(HandleRef hwndParent)
{
this.ParentHandle = hwndParent;
//BuildWindowCore should only be called if visible. Bug 1236445 tracks this.
TransitionUpTo(ActiveXHelper.ActiveXState.InPlaceActive);
//The above call should have set this interface
Invariant.Assert(_axOleInPlaceActiveObject != null, "InPlace activation of ActiveX control failed");
if (ControlHandle.Handle == IntPtr.Zero)
{
IntPtr inplaceWindow = IntPtr.Zero;
_axOleInPlaceActiveObject.GetWindow(out inplaceWindow);
AttachWindow(inplaceWindow);
}
return _axWindow;
}