Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

Forms inheritance with UIP 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gwenda - 11 Feb 2005 21:25 GMT
Hi,
We are using UIP 2.0 and we encountered a problem when trying to inherit
from a form that inherits from UIProcess.WindowsFormView. Our base form have
an onLoad event handler that call its controller:

private MyController myController
{
get
   {
     return (MyController)this.Controller;
   }
}

private void Form1_Load(object sender, System.EventArgs e)
{
 this.myController.DoSomething()
}

The problem is that the inherited from will not open in the designer as long
as we have this call to the controller in our load event.

Any ideas?

Thanks,
Gwenda
Matt Garven - 14 Feb 2005 01:17 GMT
Hi Gwenda,

Try this:

private void Form1_Load(object sender, System.EventArgs e)
{
   if (!DesignMode)
   {
       this.myController.DoSomething();
   }
}

Hope that helps.

Regards,
Matt Garven

> Hi,
> We are using UIP 2.0 and we encountered a problem when trying to inherit
[quoted text clipped - 21 lines]
> Thanks,
> Gwenda
gwenda - 15 Feb 2005 20:53 GMT
Thanks Matt, but that didn't work....It seems that only by commenting out all
the code that have a call to the controler...

> Hi Gwenda,
>
[quoted text clipped - 38 lines]
> > Thanks,
> > Gwenda
Matt Garven - 16 Feb 2005 00:31 GMT
Do you have more detail on what the error message is at the time? Any extra
detail you can post here will help to solve the problem.

You can try opening two copies of Visual Studio. With the first one, load
the solution that has the problem (don't open any of the files or the
designer at this point, and if they are open close them). With the second
one, go to the Tools Menu, find "Debug Processes" (Ctrl+Alt+P is the
shortcut). Find the other "devenv.exe" process (the one that has the solution
loaded) and attach to that. Then turn break-on-exception on (Ctrl+Alt+E) for
all CLR Exceptions.

Then open the form that you're having trouble designing. The other copy of
Visual Studio should catch the exception thrown and hopefully help you find
the problem.

Hope this helps.

Regards,
Matt Garven

> Thanks Matt, but that didn't work....It seems that only by commenting out all
> the code that have a call to the controler...
[quoted text clipped - 41 lines]
> > > Thanks,
> > > Gwenda
"Jeffrey Tan[MSFT]" - 18 Feb 2005 05:37 GMT
Hi Gwenda,

I think Matt has provided you the way of debugging design-time inherited
form. Have you tried this debug way? Is your problem resolved? Please feel
free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

gwenda - 19 Feb 2005 03:59 GMT
Hi Jeffrey and Matt and thank you both for your help. I followed Matt
suggestion but I havn't been able to get further info about the problem. The
dubugger told me what I already knew. As I said in my initial post, the
problem occure each time the base form call its controller. when I open the
inharited form in the desigener I get -    $exception    {"Object reference not set
to an instance of an object." }    System.NullReferenceException

This is why I think this is a problem in The way I implement forms
inharitace with the UIP.
Thanks,
Gwenda

> Hi Gwenda,
>
[quoted text clipped - 7 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 21 Feb 2005 05:32 GMT
Hi Gwenda,

Thanks very much for your feedback!!

For this issue, I suggest you debug into the "MyController" class code to
see which statement generates this NullReferenceException, and which
object's reference is NULL. Then we may refer to next step to find out why
this null reference object is not initilized before being used.

Anyway, I will wait for your further feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.