Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding the application Factory
Message
 
To
11/05/2007 17:42:26
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01224861
Message ID:
01225803
Views:
25
Tim,

>The AppDesktop includes this reference to the factory
>
>static Factory factory = (Factory)mmAppBase.Factory;
>
This static field is the problem. In .NET, fields (class-level variables) are set before the constructor of the class fires. So this is a timing issue. At the point where the above code executes, the Factory has not yet been instaniated. You need to set the value of the factory field in the constructor of AppDesktop. For example:
static Factory factory;

public AppDesktop()
{
    factory = (Factory)mmAppBase.Factory;
}
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform