I have attached 2 Zip files one is the .NET cs UserControl (GridSamp)with the TabControl and Grid and the other is a MFC7 (NetCtrlTest) program which launches the control. OnInitDialog has code for launching the control
Thanks
Indhu
>It is not clear why the Attach method would be throwing a Null Reference exception.
>
>private void Attach()
>{
> if(this.parentControl != null)
> {
> this.parentControl.LostFocus += new EventHandler(this.ParentLostFocus);
> Form parentForm = FindFormHelper.FindForm(this.parentControl);
> if (parentForm != null)
> {
> parentForm.Resize += new EventHandler(this.MenuCloseEvent);
> parentForm.Move += new EventHandler(this.MenuCloseEvent);
> parentForm.Deactivate += new EventHandler(this.FormDeactivate);
> if (parentForm.ParentForm != null)
> {
> parentForm.ParentForm.Move += new EventHandler(this.MenuCloseEvent);
> parentForm.ParentForm.Deactivate += new EventHandler(this.FormDeactivate);
> }
> }
> }
>}
>
>
>If you own the source code, you can step into this method to pinpoint what is null, and why it is being referenced.
>
>If you can attach a small sample, we can try to spot something here.
GridSamp_7146.zip
NetCtrlTest_8891.zip