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.

EnableThemingInScope Error???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashton - 09 Feb 2005 21:37 GMT
I am getting the following error when starting a winform app that causes the
app to simply hang and I have to end up killing it from taskmgr

Error loading main form : Object reference not set to an instance of an
object.

  at System.Windows.Forms.EnableThemingInScope..ctor(Boolean enable)
  at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
  at System.Windows.Forms.Application.DoEvents()
  at msSQLed.MainForm..ctor()

Any ideas why this would be hosing???  I looked in .NET code (using
reflector) and it looks like this method EnableThemingInScope is simply
checking to see if Themes are supported and I can't see why it would hang the
app???

Thanks,

Ashton
Matt Garven - 11 Feb 2005 02:09 GMT
Hi Ashton,

That's an odd looking callstack. Are you launching the MainForm using
Application.Run(new MainForm())?

Why does your MainForm's constructor call Application.DoEvents()?

Perhaps posting the code from your main method or the MainForm might enable
us to make some more suggestions.

Hope this helps.

Regards,
Matt Garven

> I am getting the following error when starting a winform app that causes the
> app to simply hang and I have to end up killing it from taskmgr
[quoted text clipped - 16 lines]
>
> Ashton
Ashton - 11 Feb 2005 20:27 GMT
Matt,

I do things maybe a little non-standard.  In my main method, I have
something like the following:

public class Start
{
public static Form m_Form;

static void Main()
{
Start.m_Form = new Form();
Application.Run(Start.m_Form);
}
}

In the ctor for the form I'm creating I do call DoEvents but I can't figure
out why it only breaks on one PC out of several hundred users???  Do I need
to handle things differently or might there be something specific on this
users PC?

My ctor basically checks some settings, shows an activation/registration
form if user is not registered, etc.  I could definitely remove the DoEvents
if that is what is causing the issue.

Thanks,

Ashton

> Hi Ashton,
>
[quoted text clipped - 31 lines]
> >
> > Ashton
Matt Garven - 12 Feb 2005 02:59 GMT
Hi Ashton,

If it's only breaking on one PC, perhaps you could post the specs of that
machine to the group? We've had a horrible time with our customers running
.NET software on Windows 98 machines, for example.

If you have the PC available to you for testing, I would certainly try
removing the call to Application.DoEvents(). It would be unusual to require
it before the form has become visible, especially the mainform of the
application. It's worth a shot, and if it doesn't work it would be
interesting to see the callstack of where it crashed without the call to
Application.DoEvents().

Hope this helps.

Regards,
Matt Garven

Ho

> Matt,
>
[quoted text clipped - 60 lines]
> > >
> > > Ashton

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.