PC Review


Reply
Thread Tools Rate Thread

Load form by reflection

 
 
=?Utf-8?B?Um9nZXJpbyBKdW4=?=
Guest
Posts: n/a
 
      17th Mar 2005
Hi

I try load a form by reflection :

Assembly myAssembly = Assembly.LoadFrom(dtr.GetString(0));
Form frmForm = myAssembly.CreateInstance("Nox.Grade") as Form;

but a NullReferenceException is generated.

If I use

Type type = Assembly.GetType("Nox.Grade")

it's Ok.

What is wrong ?


 
Reply With Quote
 
 
 
 
Sergey Bogdanov
Guest
Posts: n/a
 
      17th Mar 2005
It seems that the problem indeed in your form. Can you create it in this
manner?

Nox.Grade g = new Nox.Grade();


Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Rogerio Jun wrote:
> Hi
>
> I try load a form by reflection :
>
> Assembly myAssembly = Assembly.LoadFrom(dtr.GetString(0));
> Form frmForm = myAssembly.CreateInstance("Nox.Grade") as Form;
>
> but a NullReferenceException is generated.
>
> If I use
>
> Type type = Assembly.GetType("Nox.Grade")
>
> it's Ok.
>
> What is wrong ?
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Load request form fails: Could not load some objects because they arenot available on this machine Mandyli611@gmail.com Microsoft Outlook 1 5th Aug 2008 11:22 PM
Suggestions regarding reflection and dynamic load of controls bz Microsoft Dot NET 3 6th Feb 2008 08:38 AM
Reflection to load a page? Fredrik Melin Microsoft ASP .NET 1 23rd Nov 2005 01:41 PM
Load form with reflection =?Utf-8?B?Um9nZXJpbyBKdW4=?= Microsoft C# .NET 2 17th Mar 2005 03:51 PM
loading a form through reflection Brian Henry Microsoft VB .NET 2 10th Aug 2004 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.