By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

hot to differentiate outer classes and nested classes in late binding

P: n/a

when loading this dll into an assembly via late binding how do i
diferentiate between outer CAsmToLoad class and the inner class CAsmToLoad
inside of CAsmToLoad2?

public class CAsmToLoad
{
public string IOCTL(string strMsg)
{
return "hello world";
}
}

public class CAsmToLoad2
{
public string IOCTL(string strMsg)
{
return "error";
}
public class CAsmToLoad
{
public string IOCTL(string strMsg)
{
return "hello world - nested";
}
}
in the client assembly i itterate them like this currently:

protected string CallFunctionClassUnknown(string strNameSpace, string
strPath, string strMethod, string strInput, string strClass)
{
string strVal = "";
System.Reflection.Assembly SampleAssembly;
SampleAssembly = System.Reflection.Assembly.LoadFrom(strPath);
System.Type[] Types = SampleAssembly.GetTypes();
foreach (System.Type oType in Types)
{
if(oType.Name.ToString() == strClass)
{
System.Object pObj = SampleAssembly.CreateInstance(strNameSpace + "." +
oType.Name.ToString());
strVal = (oType.GetMethod(strMethod).Invoke(pObj, new object[] {
strInput } )).ToString();
}
}
return strVal;
}



Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.