R
R.Balaji
Hi,
How do I call the overloaded construction when I create the instance using
the Reflection?
for eg)
namespace MySpace
{
Interface IOrganization
{
int show();
}
}
namespace MySpace
{
class Organization : IOrganization
{
public Organization()
{
.....
}
public Organization(int orgNo)
{
.....
}
public int show()
{
.....
}
}
}
I create the instance using the reflection like this.
Assembly orgAssembly = Assembly.LoadFrom(@"c:\org.dll");
IOrganization m_organization =
(IOrganization)orgAssembly.CreateInstance("MySpace.Organization");
When I want to create an instance of the class Organization using
refelection, always it calls the default constructor.
How do I call the overloaded constructor? How do I pass the parameters?
Thanks.
Regards,
R.Balaji
How do I call the overloaded construction when I create the instance using
the Reflection?
for eg)
namespace MySpace
{
Interface IOrganization
{
int show();
}
}
namespace MySpace
{
class Organization : IOrganization
{
public Organization()
{
.....
}
public Organization(int orgNo)
{
.....
}
public int show()
{
.....
}
}
}
I create the instance using the reflection like this.
Assembly orgAssembly = Assembly.LoadFrom(@"c:\org.dll");
IOrganization m_organization =
(IOrganization)orgAssembly.CreateInstance("MySpace.Organization");
When I want to create an instance of the class Organization using
refelection, always it calls the default constructor.
How do I call the overloaded constructor? How do I pass the parameters?
Thanks.
Regards,
R.Balaji